From 72c68063a12a63f7b005b082c62890098f1e4b15 Mon Sep 17 00:00:00 2001 From: Nyabsi Date: Fri, 6 Sep 2024 21:54:26 +0300 Subject: [PATCH] if localStorage settings are null fallback i18n to "en-US" to prevent crash --- src/renderer/amethyst.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/amethyst.ts b/src/renderer/amethyst.ts index 2190de9b..6b8d65a7 100644 --- a/src/renderer/amethyst.ts +++ b/src/renderer/amethyst.ts @@ -20,7 +20,7 @@ import { useLocalStorage } from "@vueuse/core"; export const i18n = createI18n({ fallbackLocale: "en-US", // set fallback locale - locale: JSON.parse(localStorage.getItem("settings")!).language, + locale: localStorage.getItem("settings") !== null ? JSON.parse(localStorage.getItem("settings")!).language : "en-US", messages, });