Bug 1014238 - don't break on invalid customization state, r=jaws

--HG--
extra : rebase_source : a803b73d7eda4ad38073f8d280324710666c16c7
This commit is contained in:
Gijs Kruitbosch 2014-05-22 00:35:57 +01:00
parent f66598fa77
commit c32ba53958

View File

@ -1731,7 +1731,12 @@ let CustomizableUIInternal = {
}
try {
gSavedState = JSON.parse(state);
if (typeof gSavedState != "object" || gSavedState === null) {
throw "Invalid saved state";
}
} catch(e) {
Services.prefs.clearUserPref(kPrefCustomizationState);
gSavedState = {};
LOG("Error loading saved UI customization state, falling back to defaults.");
}