From 6af153cd309844bef367411f94eaa996f3333645 Mon Sep 17 00:00:00 2001 From: Edward Lee Date: Thu, 10 Jun 2010 10:57:49 -0700 Subject: [PATCH] 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. --- services/sync/modules/engines/prefs.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/services/sync/modules/engines/prefs.js b/services/sync/modules/engines/prefs.js index aaedc56bb565..924363900573 100644 --- a/services/sync/modules/engines/prefs.js +++ b/services/sync/modules/engines/prefs.js @@ -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+