diff --git a/src/lib/LocalStorage.js b/src/lib/LocalStorage.js index 3dc3458..24b8711 100644 --- a/src/lib/LocalStorage.js +++ b/src/lib/LocalStorage.js @@ -40,7 +40,12 @@ class UserSettings { case Boolean: this[key] = localStorage[key] === "true"; case Object: - this[key] = JSON.parse(localStorage[key]); + try { + this[key] = JSON.parse(localStorage[key]); + } catch(e) { + console.error(`LocalStorage: parsing key ${key}: ${e}`); + delete(this[key]); + } } } }