From 0611aba29ffe97eff0d27171fa505d30a0a8cb4e Mon Sep 17 00:00:00 2001 From: Ryan Miller Date: Thu, 28 Mar 2024 16:12:22 +1100 Subject: [PATCH] fix: add optional chainging to i18n log in case the window object is not ready --- ts/util/i18n.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts/util/i18n.ts b/ts/util/i18n.ts index 11c146c5f..499fbf331 100644 --- a/ts/util/i18n.ts +++ b/ts/util/i18n.ts @@ -12,7 +12,7 @@ import { GetMessageArgs, LocalizerDictionary, LocalizerToken } from '../types/Lo function i18nLog(message: string) { // eslint:disable: no-console // eslint-disable-next-line no-console - (window.log.error || console.log)(message); + (window?.log?.error ?? console.log)(message); } /**