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) {