Merge pull request #745 from ente-io/fix-failed-to-parse-json

add better invalid JSON data checks
This commit is contained in:
Abhinav Kumar 2022-10-18 21:40:42 +05:30 committed by GitHub
commit 80cfeb509e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
} }