Bug 1353559 - Guard against null browser in exited actor. r=ochameau draft
authorJ. Ryan Stinnett <jryans@gmail.com>
Tue, 04 Apr 2017 17:41:30 -0500
changeset 555794 3bfed155d5538464ccaa0d6fd4b75e1a616b2265
parent 555725 b043233ec04f06768d59dcdfb9e928142280f3cc
child 556134 d13b5a23400546df2983696b5ec47c74294ad53e
push id52351
push userbmo:jryans@gmail.com
push dateTue, 04 Apr 2017 22:41:45 +0000
reviewersochameau
bugs1353559
milestone55.0a1
Bug 1353559 - Guard against null browser in exited actor. r=ochameau MozReview-Commit-ID: 4TZZMywFIdu
devtools/server/actors/webbrowser.js
--- a/devtools/server/actors/webbrowser.js
+++ b/devtools/server/actors/webbrowser.js
@@ -717,17 +717,17 @@ BrowserTabActor.prototype = {
     let connect = DebuggerServer.connectToChild(this._conn, this._browser, onDestroy);
     return connect.then(form => {
       this._form = form;
       return this;
     });
   },
 
   get _tabbrowser() {
-    if (typeof this._browser.getTabBrowser == "function") {
+    if (this._browser && typeof this._browser.getTabBrowser == "function") {
       return this._browser.getTabBrowser();
     }
     return null;
   },
 
   get _mm() {
     // Get messageManager from XUL browser (which might be a specialized tunnel for RDM)
     // or else fallback to asking the frameLoader itself.
@@ -759,17 +759,17 @@ BrowserTabActor.prototype = {
   },
 
   /**
    * If we don't have a title from the content side because it's a zombie tab, try to find
    * it on the chrome side.
    */
   get title() {
     // On Fennec, we can check the session store data for zombie tabs
-    if (this._browser.__SS_restore) {
+    if (this._browser && this._browser.__SS_restore) {
       let sessionStore = this._browser.__SS_data;
       // Get the last selected entry
       let entry = sessionStore.entries[sessionStore.index - 1];
       return entry.title;
     }
     // If contentTitle is empty (e.g. on a not-yet-restored tab), but there is a
     // tabbrowser (i.e. desktop Firefox, but not Fennec), we can use the label
     // as the title.
@@ -783,17 +783,17 @@ BrowserTabActor.prototype = {
   },
 
   /**
    * If we don't have a url from the content side because it's a zombie tab, try to find
    * it on the chrome side.
    */
   get url() {
     // On Fennec, we can check the session store data for zombie tabs
-    if (this._browser.__SS_restore) {
+    if (this._browser && this._browser.__SS_restore) {
       let sessionStore = this._browser.__SS_data;
       // Get the last selected entry
       let entry = sessionStore.entries[sessionStore.index - 1];
       return entry.url;
     }
     return null;
   },