From 19f40085fa8a3fb54ff006db0a645f0e222cc1f1 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 cd86c24c..0cdc9e38 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) {