mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 07:15:46 +00:00
Bug 1338893 - Don't use the window on application-foreground if it doesn't yet exist. r=sebastian
During a cold startup, depending how this exactly plays out we might receive an application-foreground notification before the browser window is ready. Since the code to restore the selected tab if it has been left zombified while in background is only relevant if Gecko was already running and backgrounded, we can simply add a null check for the window before accessing it. MozReview-Commit-ID: Ahp5NAODKRF --HG-- extra : rebase_source : bede266e13f48fbc2f7efd40bb9277be6d2bd3bf
This commit is contained in:
parent
d0f62ee58a
commit
55ecb8b313
@ -356,8 +356,10 @@ SessionStore.prototype = {
|
||||
// If we skipped restoring a zombified tab before backgrounding,
|
||||
// we might have to do it now instead.
|
||||
let window = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
let tab = window.BrowserApp.selectedTab;
|
||||
this.restoreZombieTab(tab);
|
||||
if (window) { // Might not yet be ready during a cold startup.
|
||||
let tab = window.BrowserApp.selectedTab;
|
||||
this.restoreZombieTab(tab);
|
||||
}
|
||||
break;
|
||||
case "ClosedTabs:StartNotifications":
|
||||
this._notifyClosedTabs = true;
|
||||
|
Loading…
Reference in New Issue
Block a user