Bug 1019762 - Wallpaper over "TypeError: this.docShell is null" Promise rejections. r=felipc
CLOSED TREE
--- 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"