Bug 774009 - uncaught JS exception while running browser_overflowScroll.js (TypeError: aTab.linkedBrowser is null). r=gavin
authorDão Gottwald <dao@mozilla.com>
Sat, 29 Sep 2012 17:59:43 +0200
changeset 108742 eef8fce038aa8c19695a3aaf7be32dd20ae3792a
parent 108741 86acf4b667c822c8f14be779577b921a37a1c987
child 108743 a34cf400a83cd7733a194928107735de687cf655
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewersgavin
bugs774009
milestone18.0a1
Bug 774009 - uncaught JS exception while running browser_overflowScroll.js (TypeError: aTab.linkedBrowser is null). r=gavin
browser/base/content/browser-tabPreviews.js
--- a/browser/base/content/browser-tabPreviews.js
+++ b/browser/base/content/browser-tabPreviews.js
@@ -61,20 +61,22 @@ var tabPreviews = {
     var ctx = thumbnail.getContext("2d");
     var win = aTab.linkedBrowser.contentWindow;
     var snippetWidth = win.innerWidth * .6;
     var scale = this.width / snippetWidth;
     ctx.scale(scale, scale);
     ctx.drawWindow(win, win.scrollX, win.scrollY,
                    snippetWidth, snippetWidth * this.aspectRatio, "rgb(255,255,255)");
 
-    if (aStore) {
+    if (aStore &&
+        aTab.linkedBrowser /* bug 795608: the tab may got removed while drawing the thumbnail */) {
       aTab.__thumbnail = thumbnail;
       aTab.__thumbnail_lastURI = aTab.linkedBrowser.currentURI.spec;
     }
+
     return thumbnail;
   },
 
   handleEvent: function tabPreviews_handleEvent(event) {
     switch (event.type) {
       case "TabSelect":
         if (this._selectedTab &&
             this._selectedTab.parentNode &&