Bug 1269877: Fix timing issue in options browser resizing code. r?aswan draft
authorKris Maglione <maglione.k@gmail.com>
Thu, 02 Jun 2016 19:06:42 -0700
changeset 374975 40ef1d1fcc1570cfea6f493ea768882461856553
parent 374883 e3828d8cc57246ef2633dc7d7ef7145437f2ebf6
child 374976 b25a85b454839906ecc3431eb0fb71d31411c693
push id20127
push usermaglione.k@gmail.com
push dateFri, 03 Jun 2016 04:10:23 +0000
reviewersaswan
bugs1269877
milestone49.0a1
Bug 1269877: Fix timing issue in options browser resizing code. r?aswan MozReview-Commit-ID: 9aV8QH7w8R8
toolkit/mozapps/extensions/content/extensions.js
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -3467,16 +3467,20 @@ var gDetailView = {
         timeout = setTimeout(_resizeBrowser, TIMEOUT);
       }
     }
 
     function _resizeBrowser() {
       timeout = null;
 
       let doc = browser.contentDocument;
+      if (!doc) {
+        return;
+      }
+
       let body = doc.body || doc.documentElement;
 
       let docHeight = doc.documentElement.getBoundingClientRect().height;
 
       let height = Math.ceil(body.scrollHeight +
                              // Compensate for any offsets between the scroll
                              // area of the body and the outer height of the
                              // document.