Bug 1411794 - Fix bug where sync tabs panel would become permanently empty. r=eoger
authorThom Chiovoloni <tchiovoloni@mozilla.com>
Wed, 01 Nov 2017 21:58:55 -0400
changeset 443667 1e8a288fbac46efc922cd6767290ab4c3dab69b4
parent 443666 aa14c955261cb963a14d658a1a566cec7a65295f
child 443668 6b89155dd988772b27d81881a89f28a7cbb2a2ec
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerseoger
bugs1411794
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1411794 - Fix bug where sync tabs panel would become permanently empty. r=eoger MozReview-Commit-ID: 2mRAPhABCXA
browser/components/customizableui/CustomizableWidgets.jsm
--- a/browser/components/customizableui/CustomizableWidgets.jsm
+++ b/browser/components/customizableui/CustomizableWidgets.jsm
@@ -353,20 +353,27 @@ const CustomizableWidgets = [
       deck.setAttribute("selectedIndex", index);
     },
 
     _showTabsPromise: Promise.resolve(),
     // Update the tab list after any existing in-flight updates are complete.
     _showTabs(paginationInfo) {
       this._showTabsPromise = this._showTabsPromise.then(() => {
         return this.__showTabs(paginationInfo);
+      }, e => {
+        Cu.reportError(e);
       });
     },
     // Return a new promise to update the tab list.
     __showTabs(paginationInfo) {
+      if (!this._tabsList) {
+        // Closed between the previous `this._showTabsPromise`
+        // resolving and now.
+        return undefined;
+      }
       let doc = this._tabsList.ownerDocument;
       return SyncedTabs.getTabClients().then(clients => {
         // The view may have been hidden while the promise was resolving.
         if (!this._tabsList) {
           return;
         }
         if (clients.length === 0 && !SyncedTabs.hasSyncedThisSession) {
           // the "fetching tabs" deck is being shown - let's leave it there.