Bug 566061 - After server syncing, lightweight themes do not get applied to Chrome [r=mconnor]

Make sure the pref exists (is a bool) before trying to access its value.
This commit is contained in:
Edward Lee 2010-06-10 10:57:49 -07:00
Родитель 587c8c9d4c
Коммит 6af153cd30
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -141,8 +141,12 @@ PrefStore.prototype = {
try {
Cu.import("resource://gre/modules/LightweightThemeManager.jsm", ltm);
ltm = ltm.LightweightThemeManager;
enabledBefore = this._prefs.getBoolPref("lightweightThemes.isThemeSelected");
prevTheme = ltm.currentTheme;
let enabledPref = "lightweightThemes.isThemeSelected";
if (this._prefs.getPrefType(enabledPref) == this._prefs.PREF_BOOL) {
enabledBefore = this._prefs.getBoolPref(enabledPref);
prevTheme = ltm.currentTheme;
}
} catch(ex) {
ltmExists = false;
} // LightweightThemeManager only exists in Firefox 3.6+