Bug 924009 - Add check for whether preferences are defined before checking for lightweight theme preference. r=margaret
authorMichael Holloway <michael@hollowlog.co>
Thu, 12 Feb 2015 13:06:24 -0800
changeset 228957 c4e03c92aaf575f1a7cdbe6b30965cfd227f47cd
parent 228956 d3ac91f56ef2c092996da785496b5817d509e3f2
child 228958 0fe086880779ac1232eca6c54ac78a2304b7f81f
push id28275
push userryanvm@gmail.com
push dateFri, 13 Feb 2015 17:13:18 +0000
treeherdermozilla-central@aa339e258ccd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs924009
milestone38.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 924009 - Add check for whether preferences are defined before checking for lightweight theme preference. r=margaret
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -7651,18 +7651,19 @@ var Distribution = {
           case "undefined":
             defaults.setCharPref(key, value);
             break;
         }
       } catch (e) { /* ignore bad prefs and move on */ }
     }
 
     // Apply a lightweight theme if necessary
-    if (prefs["lightweightThemes.isThemeSelected"])
+    if (prefs && prefs["lightweightThemes.isThemeSelected"]) {
       Services.obs.notifyObservers(null, "lightweight-theme-apply", "");
+    }
 
     let localizedString = Cc["@mozilla.org/pref-localizedstring;1"].createInstance(Ci.nsIPrefLocalizedString);
     let localizeablePrefs = aData["LocalizablePreferences"];
     for (let key in localizeablePrefs) {
       try {
         let value = localizeablePrefs[key];
         value = value.replace("%LOCALE%", locale, "g");
         localizedString.data = "data:text/plain," + key + "=" + value;