From 9e7e30d7a46eded39b939e3a6b351717e4334624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Mon, 4 Nov 2013 15:59:25 +0100 Subject: [PATCH] debugger: fix unhandled error in setBreakpoint Fix Interface.setBreakpoint() to correctly handle an attempt to set a breakpoint in the current script when there is no current script. This usually happens when the debugged process is not paused. --- lib/_debugger.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/_debugger.js b/lib/_debugger.js index 4b01d39e5b55..3b22b87ef898 100644 --- a/lib/_debugger.js +++ b/lib/_debugger.js @@ -1356,6 +1356,12 @@ Interface.prototype.setBreakpoint = function(script, line, script = this.client.currentScript; } + if (script === undefined) { + this.print('Cannot determine the current script, ' + + 'make sure the debugged process is paused.'); + return; + } + if (/\(\)$/.test(script)) { // setBreakpoint('functionname()'); var req = {