diff --git a/browser/components/extensions/parent/ext-browser.js b/browser/components/extensions/parent/ext-browser.js index 09e537593a8d..45df822d065e 100644 --- a/browser/components/extensions/parent/ext-browser.js +++ b/browser/components/extensions/parent/ext-browser.js @@ -327,6 +327,9 @@ class TabTracker extends TabTrackerBase { } setId(nativeTab, id) { + if (!nativeTab.parentNode) { + throw new Error("Cannot attach ID to a destroyed tab."); + } this._tabs.set(nativeTab, id); if (nativeTab.linkedBrowser) { this._browsers.set(nativeTab.linkedBrowser, id);