Fix "Uncaught TypeError: localStorage is null" when localStorage is not available

This commit is contained in:
Lucas Cimon 2022-05-30 12:20:24 +02:00
parent 4e7284b486
commit 494e791a99
No known key found for this signature in database
GPG key ID: 08DA831E717571EE

View file

@ -34,7 +34,7 @@ export function saveLocaleData(locale: string): void {
}
export function getLocaleData(): string | null {
return localStorage.getItem(USER_LOCALE);
return localStorage ? localStorage.getItem(USER_LOCALE) : null;
}
export function saveActorData(obj: IPerson): void {