Bug 1019762 - Wallpaper over "TypeError: this.docShell is null" Promise rejections. r=felipc
authorDavid Rajchenbach-Teller <dteller@mozilla.com>
Tue, 03 Jun 2014 10:34:00 -0400
changeset 233022 e545c792a0bdf3182132ad4d0b84d8e1d90d1fdf
parent 233021 97cea18fba09be4cc9b46414e8f19da8edce3e1f
child 233023 d06ee550656ab6783fc2e066d8b02f194867a91e
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipc
bugs1019762
milestone35.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 1019762 - Wallpaper over "TypeError: this.docShell is null" Promise rejections. r=felipc CLOSED TREE
toolkit/content/widgets/browser.xml
--- a/toolkit/content/widgets/browser.xml
+++ b/toolkit/content/widgets/browser.xml
@@ -197,19 +197,25 @@
             } finally {
               if (this.userTypedClear)
                 this.userTypedClear--;
             }
           ]]>
         </body>
       </method>
 
-      <property name="currentURI"
-                onget="return this.webNavigation.currentURI;"
-                readonly="true"/>
+      <property name="currentURI" readonly="true">
+       <getter><![CDATA[
+          if (this.webNavigation) {
+            return this.webNavigation.currentURI;
+          }
+          return null;
+       ]]>
+       </getter>
+      </property>
 
       <!--
         Used by session restore to ensure that currentURI is set so
         that switch-to-tab works before the tab is fully
         restored. This function also invokes onLocationChanged
         listeners in tabbrowser.xml.
       -->
       <method name="_setCurrentURI">
@@ -311,18 +317,22 @@
       </property>
 
       <field name="_webNavigation">null</field>
 
       <property name="webNavigation"
                 readonly="true">
         <getter>
         <![CDATA[
-          if (!this._webNavigation)
-            this._webNavigation = this.docShell.QueryInterface(Components.interfaces.nsIWebNavigation);
+          if (!this._webNavigation) {
+            if (!this.docShell) {
+              return null;
+            }
+            this._webNavigation = this.docShell.QueryInterface(Ci.nsIWebNavigation);
+          }
           return this._webNavigation;
         ]]>
         </getter>
       </property>
 
       <field name="_webBrowserFind">null</field>
 
       <property name="webBrowserFind"