Bug 1302702 - Check if the threadActor is attached before using it in tab actor's _windowReady.
MozReview-Commit-ID: IexaXRL27Lu
--- a/devtools/server/actors/tab.js
+++ b/devtools/server/actors/tab.js
@@ -1163,16 +1163,22 @@ TabActor.prototype = {
this._windowDestroyed(this.window, null, true);
// Immediately change the window as this window, if in process of unload
// may already be non working on the next cycle and start throwing
this._setWindow(window);
DevToolsUtils.executeSoon(() => {
+ // No need to do anything more if the actor is not attached anymore
+ // e.g. the client has been closed and the actors destroyed in the meantime.
+ if (!this.attached) {
+ return;
+ }
+
// Then fake window-ready and navigate on the given document
this._windowReady(window, true);
DevToolsUtils.executeSoon(() => {
this._navigate(window, true);
});
});
},