Skip to content

Commit d998186

Browse files
committed
fix(local-storage.service): provide null for empty Storage.getItem() value
1 parent 19213f9 commit d998186

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

projects/coreui-angular/src/lib/services/local-storage.service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class LocalStorageService {
2828
}
2929

3030
public getItem(key: string): any {
31-
const data = JSON.parse(this.#localStorage.getItem(key) ?? 'null');
31+
const data = JSON.parse(this.#localStorage.getItem(key) || 'null');
3232
this.#data$.next({ key, data });
3333
return data;
3434
}

0 commit comments

Comments
 (0)