Bug 1368823 - Do not access updater elements in Preferences panel when updater is compiled out. r=Paenglab
authoraceman <acelists@atlas.sk>
Thu, 01 Jun 2017 13:38:00 +0200
changeset 21623 3b89a5265c23eb2d1412eb210e976cae0c3eb8e2
parent 21622 22d34b082d5c3b9498d424781b3b24e8f3c536f0
child 21624 4c75875995a40e4586770d54d01e83967cc1ebe8
push id13179
push usermozilla@jorgk.com
push dateSat, 03 Jun 2017 06:50:22 +0000
treeherdercomm-central@3b89a5265c23 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersPaenglab
bugs1368823
Bug 1368823 - Do not access updater elements in Preferences panel when updater is compiled out. r=Paenglab
mail/components/preferences/advanced.js
--- a/mail/components/preferences/advanced.js
+++ b/mail/components/preferences/advanced.js
@@ -81,54 +81,54 @@ var gAdvancedPane = {
         document.getElementById("alwaysCheckDefault").disabled = true;
         document.getElementById("alwaysCheckDefault").checked = false;
       }
       if (document.getElementById("checkDefaultButton"))
         document.getElementById("checkDefaultButton").disabled = true;
       this.mShellServiceWorking = false;
     }
 
-    let distroId = Services.prefs.getCharPref("distribution.id" , "");
-    if (distroId) {
-      let distroVersion = Services.prefs.getCharPref("distribution.version");
+    if (AppConstants.MOZ_UPDATER) {
+      let distroId = Services.prefs.getCharPref("distribution.id" , "");
+      if (distroId) {
+        let distroVersion = Services.prefs.getCharPref("distribution.version");
 
-      let distroIdField = document.getElementById("distributionId");
-      distroIdField.value = distroId + " - " + distroVersion;
-      distroIdField.style.display = "block";
+        let distroIdField = document.getElementById("distributionId");
+        distroIdField.value = distroId + " - " + distroVersion;
+        distroIdField.style.display = "block";
 
-      let distroAbout = Services.prefs.getStringPref("distribution.about", "");
-      if (distroAbout) {
-        let distroField = document.getElementById("distribution");
-        distroField.value = distroAbout;
-        distroField.style.display = "block";
+        let distroAbout = Services.prefs.getStringPref("distribution.about", "");
+        if (distroAbout) {
+          let distroField = document.getElementById("distribution");
+          distroField.value = distroAbout;
+          distroField.style.display = "block";
+        }
       }
-    }
 
-    let version = AppConstants.MOZ_APP_VERSION_DISPLAY;
+      let version = AppConstants.MOZ_APP_VERSION_DISPLAY;
 
-    // Include the build ID and display warning if this is an "a#" (nightly) build
-    if (/a\d+$/.test(version)) {
-      let buildID = Services.appinfo.appBuildID;
-      let year = buildID.slice(0, 4);
-      let month = buildID.slice(4, 6);
-      let day = buildID.slice(6, 8);
-      version += ` (${year}-${month}-${day})`;
-    }
+      // Include the build ID and display warning if this is an "a#" (nightly) build
+      if (/a\d+$/.test(version)) {
+        let buildID = Services.appinfo.appBuildID;
+        let year = buildID.slice(0, 4);
+        let month = buildID.slice(4, 6);
+        let day = buildID.slice(6, 8);
+        version += ` (${year}-${month}-${day})`;
+      }
 
-    // Append "(32-bit)" or "(64-bit)" build architecture to the version number:
-    let bundle = Services.strings.createBundle("chrome://messenger/locale/messenger.properties");
-    let archResource = Services.appinfo.is64Bit
-                       ? "aboutDialog.architecture.sixtyFourBit"
-                       : "aboutDialog.architecture.thirtyTwoBit";
-    let arch = bundle.GetStringFromName(archResource);
-    version += ` (${arch})`;
+      // Append "(32-bit)" or "(64-bit)" build architecture to the version number:
+      let bundle = Services.strings.createBundle("chrome://messenger/locale/messenger.properties");
+      let archResource = Services.appinfo.is64Bit
+                         ? "aboutDialog.architecture.sixtyFourBit"
+                         : "aboutDialog.architecture.thirtyTwoBit";
+      let arch = bundle.GetStringFromName(archResource);
+      version += ` (${arch})`;
 
-    document.getElementById("version").textContent = version;
+      document.getElementById("version").textContent = version;
 
-    if (AppConstants.MOZ_UPDATER) {
       gAppUpdater = new appUpdater();
     }
 
     if (this._loadInContent) {
       gSubDialog.init();
     }
 
     this.mInitialized = true;