diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 9cd65d52562..de052a3d311 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -2423,8 +2423,13 @@ var DesktopUserAgent = { _getWindowForRequest: function ua_getWindowForRequest(aRequest) { let loadContext = this._getRequestLoadContext(aRequest); - if (loadContext) - return loadContext.associatedWindow; + if (loadContext) { + try { + return loadContext.associatedWindow; + } catch (e) { + // loadContext.associatedWindow can throw when there's no window + } + } return null; },