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 (
|
||||
typeof localStorage === 'undefined' ||
|
||||
typeof key === 'undefined' ||
|
||||
typeof localStorage.getItem(key) === 'undefined'
|
||||
typeof localStorage.getItem(key) === 'undefined' ||
|
||||
localStorage.getItem(key) === 'undefined'
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue