Bug 1249608 - Don't run UI migration steps with new profiles. r=gijs
authorDão Gottwald <dao@mozilla.com>
Sat, 20 Feb 2016 14:04:03 +0100
changeset 332764 ca83a163091aff314159011e639520f25daa3a99
parent 332763 48a7a7615da812d4adca2d9aa4e9a10ac259bebc
child 332765 eff6731606da854ee031a06a64191484c09e72e4
push id11232
push useratolfsen@mozilla.com
push dateSun, 21 Feb 2016 12:02:10 +0000
reviewersgijs
bugs1249608
milestone47.0a1
Bug 1249608 - Don't run UI migration steps with new profiles. r=gijs
browser/components/nsBrowserGlue.js
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -1803,20 +1803,26 @@ BrowserGlue.prototype = {
                                                     notifyBox.PRIORITY_CRITICAL_MEDIUM,
                                                     buttons);
     notification.persistence = -1; // Until user closes it
   },
 
   _migrateUI: function BG__migrateUI() {
     const UI_VERSION = 36;
     const BROWSER_DOCURL = "chrome://browser/content/browser.xul";
-    let currentUIVersion = 0;
-    try {
+
+    let currentUIVersion;
+    if (Services.prefs.prefHasUserValue("browser.migration.version") {
       currentUIVersion = Services.prefs.getIntPref("browser.migration.version");
-    } catch(ex) {}
+    } else {
+      // This is a new profile, nothing to migrate.
+      Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
+      return;
+    }
+
     if (currentUIVersion >= UI_VERSION)
       return;
 
     let xulStore = Cc["@mozilla.org/xul/xulstore;1"].getService(Ci.nsIXULStore);
 
     if (currentUIVersion < 2) {
       // This code adds the customizable bookmarks button.
       let currentset = xulStore.getValue(BROWSER_DOCURL, "nav-bar", "currentset");