Bug 930970 - add nullcheck because of bug 938694 and flushing, to ensure the migration works correctly, r=jaws
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Thu, 14 Nov 2013 19:42:36 +0100
changeset 155019 6b335ebfebd96bc75f7c5babde2c403347c0058d
parent 155018 c09869a048828e92809958e9e402a2362e21aebe
child 155020 d8173efa5e8c1cbe12b8e967dd3e0c70b8a85c5a
child 155157 8c20a3bb8b818680e4b8851c67bc67ec4af8f0d8
push id3494
push usergijskruitbosch@gmail.com
push dateSun, 17 Nov 2013 21:32:50 +0000
treeherderfx-team@6b335ebfebd9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs930970, 938694
milestone28.0a1
Bug 930970 - add nullcheck because of bug 938694 and flushing, to ensure the migration works correctly, r=jaws
browser/components/nsBrowserGlue.js
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -1301,31 +1301,39 @@ BrowserGlue.prototype = {
 
     // No version check for this as this code should run until we have Australis everywhere:
     if (wasCustomizedAndOnAustralis) {
       // This profile's been on australis! If it's missing the back/fwd button
       // or go/stop/reload button, then put them back:
       let currentsetResource = this._rdf.GetResource("currentset");
       let toolbarResource = this._rdf.GetResource(BROWSER_DOCURL + "nav-bar");
       let currentset = this._getPersist(toolbarResource, currentsetResource);
-      if (currentset.indexOf("unified-back-forward-button") == -1) {
-        currentset = currentset.replace("urlbar-container",
-                                        "unified-back-forward-button,urlbar-container");
+      let oldCurrentset = currentset;
+      if (currentset) {
+        if (currentset.indexOf("unified-back-forward-button") == -1) {
+          currentset = currentset.replace("urlbar-container",
+                                          "unified-back-forward-button,urlbar-container");
+        }
+        if (currentset.indexOf("reload-button") == -1) {
+          currentset = currentset.replace("urlbar-container", "urlbar-container,reload-button");
+        }
+        if (currentset.indexOf("stop-button") == -1) {
+          currentset = currentset.replace("reload-button", "reload-button,stop-button");
+        }
       }
-      if (currentset.indexOf("reload-button") == -1) {
-        currentset = currentset.replace("urlbar-container", "urlbar-container,reload-button");
-      }
-      if (currentset.indexOf("stop-button") == -1) {
-        currentset = currentset.replace("reload-button", "reload-button,stop-button");
-      }
-      this._setPersist(toolbarResource, currentsetResource, currentset);
       Services.prefs.clearUserPref("browser.uiCustomization.state");
 
+      if (oldCurrentset != currentset) {
+        this._setPersist(toolbarResource, currentsetResource, currentset);
+      }
       // If we don't have anything else to do, we can bail here:
       if (currentUIVersion >= UI_VERSION) {
+        if (this._dirty) {
+          this._dataSource.QueryInterface(Ci.nsIRDFRemoteDataSource).Flush();
+        }
         delete this._rdf;
         delete this._dataSource;
         return;
       }
     }
 
 
     this._dirty = false;