Fixed JSON.parse exceptions

This commit is contained in:
Igor Zhukov 2014-09-15 19:30:13 +04:00
parent 66d579caad
commit ff3bb02fa0

View File

@ -107,7 +107,11 @@ Config.LangCountries = {"es": "ES", "ru": "RU", "en": "US", "de": "DE", "it": "I
}
else if (useLs) {
var value = localStorage.getItem(key);
value = (value === undefined || value === null) ? false : JSON.parse(value);
try {
value = (value === undefined || value === null) ? false : JSON.parse(value);
} catch (e) {
value = false;
}
result.push(cache[key] = value);
}
else if (!useCs) {