fix: replace all direct JSON.parse usages with safe parsing utilities

This commit is contained in:
shubhamsharma9199
2025-11-03 22:54:51 +05:30
parent 59b4739524
commit 7a09215e96
6 changed files with 47 additions and 11 deletions
@@ -1,4 +1,5 @@
import { Injectable, EventEmitter } from '@angular/core';
import { safeParseObject } from 'app/core/utils/json';
import { Theme } from './theme.model';
import { ThemeManagerService } from './theme-manager.service';
@@ -19,7 +20,7 @@ export class ThemeStorageService {
}
getTheme(): Theme {
return JSON.parse(localStorage.getItem(this.themeStorageKey));
return safeParseObject<Theme | null>(localStorage.getItem(this.themeStorageKey), null);
}
clearTheme() {