Skip to content

Commit 0caa5c4

Browse files
committed
Fix: Add null check in versionIsInvalid to prevent runtime crash
1 parent ffd0381 commit 0caa5c4

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

libs/ngxs/storage/utils/deserialize-by-storage-meta.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ export function deserializeByStorageMeta<T>(
3535
}
3636

3737
function versionIsInvalid<T>(meta: StorageMeta<T>): boolean {
38+
if (!meta) {
39+
return true;
40+
}
41+
3842
const version: number = parseFloat(meta.version?.toString() ?? '');
3943

4044
return (

0 commit comments

Comments
 (0)