Bug 1307871 - Allow null frames object to prevent throwing when there aren't sources on the page;r=jlongster draft
authorBrian Grinstead <bgrinstead@mozilla.com>
Tue, 15 Nov 2016 10:13:24 -0800
changeset 439269 92eb616afa42c6f5e0d2a205cf452a8dd1230869
parent 439149 f8ba9c9b401f57b0047ddd6932cb830190865b38
child 537114 fbec35671962b70e9d68125da589f68d77f477ac
push id35946
push userbgrinstead@mozilla.com
push dateTue, 15 Nov 2016 18:13:57 +0000
reviewersjlongster
bugs1307871
milestone53.0a1
Bug 1307871 - Allow null frames object to prevent throwing when there aren't sources on the page;r=jlongster MozReview-Commit-ID: 13K7lThy5fg
devtools/client/debugger/new/panel.js
--- a/devtools/client/debugger/new/panel.js
+++ b/devtools/client/debugger/new/panel.js
@@ -45,17 +45,17 @@ 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) {
+    if (!frames || !frames.toJS) {
       return {
         frames: [],
         selected: -1
       }
     }
 
     frames = frames.toJS();
     const selectedFrame = this._selectors().getSelectedFrame(this._getState());