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 209807 e545c792a0bdf3182132ad4d0b84d8e1d90d1fdf
parent 209806 97cea18fba09be4cc9b46414e8f19da8edce3e1f
child 209808 d06ee550656ab6783fc2e066d8b02f194867a91e
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersfelipc
bugs1019762
milestone35.0a1
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"