Merge pull request #745 from ente-io/fix-failed-to-parse-json
add better invalid JSON data checks
This commit is contained in:
commit
80cfeb509e
|
@ -40,7 +40,8 @@ export const getData = (key: LS_KEYS) => {
|
||||||
if (
|
if (
|
||||||
typeof localStorage === 'undefined' ||
|
typeof localStorage === 'undefined' ||
|
||||||
typeof key === 'undefined' ||
|
typeof key === 'undefined' ||
|
||||||
typeof localStorage.getItem(key) === 'undefined'
|
typeof localStorage.getItem(key) === 'undefined' ||
|
||||||
|
localStorage.getItem(key) === 'undefined'
|
||||||
) {
|
) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue