diff --git a/lib/chrome.js b/lib/chrome.js index fadf2cd..0c9ce03 100644 --- a/lib/chrome.js +++ b/lib/chrome.js @@ -496,11 +496,15 @@ var ChromeObject = function() { this.checkDebuggingPort = function() { var isChecked = false; - if (this.debuggingPort > 0) { - var result = SHELL.exec("netstat -ano | findstr :" + this.debuggingPort); - if (result.indexOf(":" + this.debuggingPort) > -1) { - isChecked = true; + try { + if (this.debuggingPort > 0) { + var result = SHELL.exec("netstat -ano | findstr :" + this.debuggingPort); + if (result.indexOf(":" + this.debuggingPort) > -1) { + isChecked = true; + } } + } catch(e) { + console.error("ChromeObject.checkDebuggingPort() -> " + e.message); } return isChecked;