Bug 1333324 - Check for a potentially null or undefined browser.currentURI in _capture since it runs off of a timeout and the browser may not have a webNavigation associated with it anymore. r?florian draft
authorJared Wein <jwein@mozilla.com>
Mon, 13 Feb 2017 18:06:33 -0500
changeset 483170 a6a6d6c7cbdc6f74ab8d2e51f4f2d2e103b26f95
parent 481472 f1d230c4b838da8fe7200def634652d8c146d20e
child 484168 5090833f14813883314f74f8901f6c313b75ec2f
push id45247
push userbmo:jaws@mozilla.com
push dateMon, 13 Feb 2017 23:07:04 +0000
reviewersflorian
bugs1333324
milestone54.0a1
Bug 1333324 - Check for a potentially null or undefined browser.currentURI in _capture since it runs off of a timeout and the browser may not have a webNavigation associated with it anymore. r?florian MozReview-Commit-ID: 1FWGSl9yefO
browser/base/content/browser-thumbnails.js
--- a/browser/base/content/browser-thumbnails.js
+++ b/browser/base/content/browser-thumbnails.js
@@ -87,17 +87,18 @@ var gBrowserThumbnails = {
                                                    aRequest, aStateFlags, aStatus) {
     if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP &&
         aStateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK)
       this._delayedCapture(aBrowser);
   },
 
   _capture: function Thumbnails_capture(aBrowser) {
     // Only capture about:newtab top sites.
-    if (this._topSiteURLs.indexOf(aBrowser.currentURI.spec) == -1)
+    if (!aBrowser.currentURI ||
+        this._topSiteURLs.indexOf(aBrowser.currentURI.spec) == -1)
       return;
     this._shouldCapture(aBrowser, function(aResult) {
       if (aResult) {
         PageThumbs.captureAndStoreIfStale(aBrowser);
       }
     });
   },