Bug 1919721 - Check size before building an empty placements list from gFuturePlacements in CustomizableUI. r=mconley

Differential Revision: https://phabricator.services.mozilla.com/D224268
This commit is contained in:
Sam Foster
2024-10-02 00:57:15 +00:00
parent d6722b5ab0
commit d888c32cc4

View File

@@ -2934,7 +2934,7 @@ var CustomizableUIInternal = {
getAreaPlacementsForSaving(area) {
// An early call to saveState can occur before all the lazy-area building is complete
let placements;
if (this.isAreaLazy(area) && gFuturePlacements.has(area)) {
if (this.isAreaLazy(area) && gFuturePlacements.get(area)?.size) {
placements = [...gFuturePlacements.get(area)];
} else if (gPlacements.has(area)) {
placements = gPlacements.get(area);