From e7b00c46586b3c286a137e81d82af8843e488f6c Mon Sep 17 00:00:00 2001 From: Varun Dey Date: Wed, 29 Jul 2020 15:22:48 +0000 Subject: [PATCH] Bug 1634988 - guard state against being undefined in BrowserElementParent. r=mconley Differential Revision: https://phabricator.services.mozilla.com/D84896 --- toolkit/actors/BrowserElementParent.jsm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/toolkit/actors/BrowserElementParent.jsm b/toolkit/actors/BrowserElementParent.jsm index 0f27b368de14..8798ea60333f 100644 --- a/toolkit/actors/BrowserElementParent.jsm +++ b/toolkit/actors/BrowserElementParent.jsm @@ -311,6 +311,11 @@ var PermitUnloader = { _transitionFrameState(windowGlobal, newFrameState) { let frameLoader = windowGlobal.rootFrameLoader; let state = this.inProgressPermitUnload.get(frameLoader); + + if (!state) { + return; + } + let oldFrameState = state.frameStates.get(windowGlobal); if (oldFrameState == STATE_WAITING) {