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

Commit

Permalink
debugger: fix unhandled error in setBreakpoint
Browse files Browse the repository at this point in the history
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 <christopher.s.dickinson@gmail.com>
  • Loading branch information
bajtos authored and chrisdickinson committed Dec 17, 2014
1 parent 6f6a979 commit e93ff4f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/_debugger.js
Original file line number Diff line number Diff line change
Expand Up @@ -1360,6 +1360,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 = {
Expand Down

0 comments on commit e93ff4f

Please sign in to comment.