Bug 1317819 - avoid typeerror when getting debugger frames from webconsole;r=jlast draft
authorJulian Descottes <jdescottes@mozilla.com>
Tue, 15 Nov 2016 23:31:17 +0100
changeset 439366 26b662b88b95fa9089132ea3517cd2cae6c7413a
parent 439149 f8ba9c9b401f57b0047ddd6932cb830190865b38
child 439367 b84fa607867f2d492aaadf6bfadced2a0651f1b4
child 440508 d68820ffadcb8a33dbca8161dda5f4c427d50b67
push id35985
push userjdescottes@mozilla.com
push dateTue, 15 Nov 2016 22:39:10 +0000
reviewersjlast
bugs1317819
milestone53.0a1
Bug 1317819 - avoid typeerror when getting debugger frames from webconsole;r=jlast MozReview-Commit-ID: 46xtLlqQnfn
devtools/client/debugger/new/panel.js
--- a/devtools/client/debugger/new/panel.js
+++ b/devtools/client/debugger/new/panel.js
@@ -44,18 +44,18 @@ DebuggerPanel.prototype = {
 
   _selectors: function() {
     return this.panelWin.Debugger.selectors;
   },
 
   getFrames: function() {
     let frames = this._selectors().getFrames(this._getState());
 
-    // frames is an empty array when the debugger is not paused
-    if (!frames.toJS) {
+    // frames is null when the debugger is not paused
+    if (!frames) {
       return {
         frames: [],
         selected: -1
       }
     }
 
     frames = frames.toJS();
     const selectedFrame = this._selectors().getSelectedFrame(this._getState());