Bug 1419042 - Only use the distroVersion if the pref contains a value, otherwise leave it out of the version string. r=evanxd a=gchang
authorJared Wein <jwein@mozilla.com>
Mon, 20 Nov 2017 10:50:23 -0500
changeset 444884 1f8410489ea613583bed4cd8f694f001366b0e80
parent 444883 66e9aa40d7e789d106f25381e30a2a81bbb4dc4f
child 444885 6b525d020e68dca9f535c77518c9aad924e11657
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)
reviewersevanxd, gchang
bugs1419042
milestone58.0
Bug 1419042 - Only use the distroVersion if the pref contains a value, otherwise leave it out of the version string. r=evanxd a=gchang MozReview-Commit-ID: Pign2W4RfE
browser/base/content/aboutDialog.js
browser/components/preferences/in-content/main.js
--- a/browser/base/content/aboutDialog.js
+++ b/browser/base/content/aboutDialog.js
@@ -11,20 +11,25 @@ Components.utils.import("resource://gre/
 Components.utils.import("resource://gre/modules/AppConstants.jsm");
 
 function init(aEvent) {
   if (aEvent.target != document)
     return;
 
   var distroId = Services.prefs.getCharPref("distribution.id", "");
   if (distroId) {
-    var distroVersion = Services.prefs.getCharPref("distribution.version");
+    var distroString = distroId;
+
+    var distroVersion = Services.prefs.getCharPref("distribution.version", "");
+    if (distroVersion) {
+      distroString += " - " + distroVersion;
+    }
 
     var distroIdField = document.getElementById("distributionId");
-    distroIdField.value = distroId + " - " + distroVersion;
+    distroIdField.value = distroString;
     distroIdField.style.display = "block";
 
     var distroAbout = Services.prefs.getStringPref("distribution.about", "");
     if (distroAbout) {
       var distroField = document.getElementById("distribution");
       distroField.value = distroAbout;
       distroField.style.display = "block";
     }
--- a/browser/components/preferences/in-content/main.js
+++ b/browser/components/preferences/in-content/main.js
@@ -354,20 +354,25 @@ var gMainPane = {
       if (relNotesURL != "about:blank") {
         relNotesLink.href = relNotesURL;
         relNotesLink.hidden = false;
       }
     }
 
     let distroId = Services.prefs.getCharPref("distribution.id", "");
     if (distroId) {
-      let distroVersion = Services.prefs.getCharPref("distribution.version");
+      let distroString = distroId;
+
+      let distroVersion = Services.prefs.getCharPref("distribution.version", "");
+      if (distroVersion) {
+        distroString += " - " + distroVersion;
+      }
 
       let distroIdField = document.getElementById("distributionId");
-      distroIdField.value = distroId + " - " + distroVersion;
+      distroIdField.value = distroString;
       distroIdField.hidden = false;
 
       let distroAbout = Services.prefs.getStringPref("distribution.about", "");
       if (distroAbout) {
         let distroField = document.getElementById("distribution");
         distroField.value = distroAbout;
         distroField.hidden = false;
       }