Bug 1240881 - Fail more gracefully if webconsole actor is using a non-live Frame for evaluation. r=jlongster
authorBrian Grinstead <bgrinstead@mozilla.com>
Fri, 05 Feb 2016 15:41:00 -0500
changeset 287326 97e1bc41a84754b72417f2f33c6531e2abce8447
parent 287325 a5c5f12698e05859a4ceac9163ee7aef9191c749
child 287327 d45c2b6da860b821d291d2bf0a1cf084d962961d
push id18080
push userryanvm@gmail.com
push dateWed, 09 Mar 2016 02:53:13 +0000
treeherderfx-team@990089efe3f6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlongster
bugs1240881
milestone48.0a1
Bug 1240881 - Fail more gracefully if webconsole actor is using a non-live Frame for evaluation. r=jlongster
devtools/server/actors/webconsole.js
--- a/devtools/server/actors/webconsole.js
+++ b/devtools/server/actors/webconsole.js
@@ -927,21 +927,22 @@ WebConsoleActor.prototype =
     let frameActorId = aRequest.frameActor;
     let dbgObject = null;
     let environment = null;
     let hadDebuggee = false;
 
     // This is the case of the paused debugger
     if (frameActorId) {
       let frameActor = this.conn.getActor(frameActorId);
-      if (frameActor) {
+      try {
+        // Need to try/catch since accessing frame.environment
+        // can throw "Debugger.Frame is not live"
         let frame = frameActor.frame;
         environment = frame.environment;
-      }
-      else {
+      } catch(e) {
         DevToolsUtils.reportException("onAutocomplete",
           Error("The frame actor was not found: " + frameActorId));
       }
     }
     // This is the general case (non-paused debugger)
     else {
       hadDebuggee = this.dbg.hasDebuggee(this.evalWindow);
       dbgObject = this.dbg.addDebuggee(this.evalWindow);