Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Commit e93ff4f

Browse files
bajtoschrisdickinson
authored andcommitted
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. Fixes: #6453 PR-URL: #6460 Reviewed-By: Chris Dickinson <[email protected]>
1 parent 6f6a979 commit e93ff4f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/_debugger.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,6 +1360,12 @@ Interface.prototype.setBreakpoint = function(script, line,
13601360
script = this.client.currentScript;
13611361
}
13621362

1363+
if (script === undefined) {
1364+
this.print('Cannot determine the current script, ' +
1365+
'make sure the debugged process is paused.');
1366+
return;
1367+
}
1368+
13631369
if (/\(\)$/.test(script)) {
13641370
// setBreakpoint('functionname()');
13651371
var req = {

0 commit comments

Comments
 (0)