From d564d1d1c00570f5c4985e647859a8cfee7a8fd3 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Mon, 13 May 2024 18:20:58 -0400 Subject: [PATCH] there is a situation in tests where window is defined but window.location is undefined --- app/common/BaseAPI.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/common/BaseAPI.ts b/app/common/BaseAPI.ts index cd86c24c039..0cdc9e38e78 100644 --- a/app/common/BaseAPI.ts +++ b/app/common/BaseAPI.ts @@ -66,7 +66,7 @@ export class BaseAPI { // This is a fallback mechanism if auth is broken to access the // admin panel. // TODO: should this be more selective? - if (typeof window !== 'undefined') { + if (typeof window !== 'undefined' && window.location) { const url = new URL(window.location.href); const bootKey = url.searchParams.get('boot'); if (bootKey) {