Skip to content

Commit

Permalink
[ECO-2516] Prevent JSON deserialization issue (#420) (#425)
Browse files Browse the repository at this point in the history
Co-authored-by: Bogdan Crisan <[email protected]>
  • Loading branch information
xbtmatt and CRBl69 authored Nov 28, 2024
1 parent 1b45912 commit 29989a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/typescript/frontend/src/configs/local-storage-keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export function readLocalStorageCache<T>(key: keyof typeof LOCAL_STORAGE_KEYS):
if (str === null) {
return null;
}
const cache = parseJSON<LocalStorageCache<T>>(str);
try {
const cache = parseJSON<LocalStorageCache<T>>(str);
if (new Date(cache.expiry) > new Date()) {
return cache.data;
}
Expand Down

0 comments on commit 29989a9

Please sign in to comment.