Bug 1865154 - Add check for activeIndex in tabState.entries r=sessionstore-reviewers,sfoster

* Only add previously open tabs to the newWindowState in _prepDataForDeferredRestore
if they have entries

Differential Revision: https://phabricator.services.mozilla.com/D196157
This commit is contained in:
Sarah Clements
2023-12-18 16:55:11 +00:00
parent 5b4510041c
commit 7bc0261e9d

View File

@@ -6532,6 +6532,7 @@ var SessionStoreInternal = {
activeIndex = Math.min(activeIndex, tabState.entries.length - 1);
activeIndex = Math.max(activeIndex, 0);
if (activeIndex in tabState.entries) {
let title =
tabState.entries[activeIndex].title ||
tabState.entries[activeIndex].url;
@@ -6555,6 +6556,7 @@ var SessionStoreInternal = {
);
}
}
}
tIndex++;
}