Bug 710578 - Pages without contentDocument cause JSON exception in handleLocationChange [r=mfinkle a=javascript]
authorMatt Brubeck <mbrubeck@mozilla.com>
Wed, 14 Dec 2011 16:36:29 -0500
changeset 82593 5ef118dcf1a1455b0b2d0e0f78ad78c0d42fc458
parent 82592 b0213baf29050f71710bd040e93daa86b517f3f3
child 82594 7e74a12601a4c078f87ae93c17c3e48b40db2596
push idunknown
push userunknown
push dateunknown
reviewersmfinkle, javascript
bugs710578
milestone11.0a1
Bug 710578 - Pages without contentDocument cause JSON exception in handleLocationChange [r=mfinkle a=javascript]
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -1392,18 +1392,22 @@ Tab.prototype = {
 
   onLocationChange: function(aWebProgress, aRequest, aLocationURI, aFlags) {
     let contentWin = aWebProgress.DOMWindow;
     if (contentWin != contentWin.top)
         return;
 
     let browser = BrowserApp.getBrowserForWindow(contentWin);
     let uri = browser.currentURI.spec;
-    let documentURI = browser.contentDocument.documentURIObject.spec;
-    let contentType = browser.contentDocument.contentType;
+    let documentURI = "";
+    let contentType = "";
+    if (browser.contentDocument) {
+      documentURI = browser.contentDocument.documentURIObject.spec;
+      contentType = browser.contentDocument.contentType;
+    }
 
     let message = {
       gecko: {
         type: "Content:LocationChange",
         tabID: this.id,
         uri: uri,
         documentURI: documentURI,
         contentType: contentType