Bug 1519461 - Check for frameLoader existence before accessing it in docShellIsActive;r=mconley
authorBrian Grinstead <bgrinstead@mozilla.com>
Mon, 14 Jan 2019 20:36:16 +0000
changeset 510912 c036c740fbbc3e0fb8a4270ef029aaa160d30c9a
parent 510911 36ec37a680354b2a1fb3b2232f24a65172d71962
child 510913 e00e03df2c6b67ddb2be816cca1be77d5b3ef25d
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1519461
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1519461 - Check for frameLoader existence before accessing it in docShellIsActive;r=mconley Alternatively, we could check for mInitialized in `AsyncTabSwitcher.logState` before accessing the getter. But this matches an existing pattern for other browser getters that rely on the frameLoader existing, and will support other callers that hit this case. Differential Revision: https://phabricator.services.mozilla.com/D16368
toolkit/content/widgets/browser-custom-element.js
--- a/toolkit/content/widgets/browser-custom-element.js
+++ b/toolkit/content/widgets/browser-custom-element.js
@@ -372,27 +372,34 @@ class MozBrowser extends MozElementMixin
   }
 
   get dateTimePicker() {
     return document.getElementById(this.getAttribute("datetimepicker"));
   }
 
   set docShellIsActive(val) {
     if (this.isRemoteBrowser) {
-      this.frameLoader.tabParent.docShellIsActive = val;
-      return val;
+      let { frameLoader } = this;
+      if (frameLoader && frameLoader.tabParent) {
+        return frameLoader.tabParent.docShellIsActive = val;
+      }
+      return false;
     }
     if (this.docShell)
       return this.docShell.isActive = val;
     return false;
   }
 
   get docShellIsActive() {
     if (this.isRemoteBrowser) {
-      return this.frameLoader.tabParent.docShellIsActive;
+      let { frameLoader } = this;
+      if (frameLoader && frameLoader.tabParent) {
+        return frameLoader.tabParent.docShellIsActive;
+      }
+      return false;
     }
     return this.docShell && this.docShell.isActive;
   }
 
   set renderLayers(val) {
     if (this.isRemoteBrowser) {
       let { frameLoader } = this;
       if (frameLoader && frameLoader.tabParent) {