Fix error when accessing undefined StoredState values

This commit is contained in:
Talia 2023-12-22 00:59:28 +01:00
parent de88e6a9d6
commit 04ab913b72
Signed by: darkwiiplayer
GPG Key ID: 7808674088232B3E
1 changed files with 2 additions and 1 deletions

View File

@ -179,7 +179,8 @@ export class StoredState extends State {
get(prop) {
if (prop == "value") prop = this.#valueKey
return JSON.parse(this.#storage[prop])
const value = this.#storage[prop]
return value && JSON.parse(value)
}
}