Bug 1353559 - Guard against null browser in exited actor. r=ochameau
MozReview-Commit-ID: 4TZZMywFIdu
--- 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;
},