Browse Source

Fixed JSON.parse exceptions

master
Igor Zhukov 10 years ago
parent
commit
ff3bb02fa0
  1. 6
      app/js/lib/config.js

6
app/js/lib/config.js

@ -107,7 +107,11 @@ Config.LangCountries = {"es": "ES", "ru": "RU", "en": "US", "de": "DE", "it": "I
} }
else if (useLs) { else if (useLs) {
var value = localStorage.getItem(key); 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); result.push(cache[key] = value);
} }
else if (!useCs) { else if (!useCs) {

Loading…
Cancel
Save