fix: replace all direct JSON.parse usages with safe parsing utilities
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user