From 494e791a99d7d1a2462e18e984bda821c89ce807 Mon Sep 17 00:00:00 2001 From: Lucas Cimon <1782-Lucas-C@users.noreply.framagit.org> Date: Mon, 30 May 2022 12:20:24 +0200 Subject: [PATCH] Fix "Uncaught TypeError: localStorage is null" when localStorage is not available --- js/src/utils/auth.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/utils/auth.ts b/js/src/utils/auth.ts index e34db00c6..c0657c2e7 100644 --- a/js/src/utils/auth.ts +++ b/js/src/utils/auth.ts @@ -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 {