From d448db5ed773f911ed65017f4a2e8ff3aaaa9d07 Mon Sep 17 00:00:00 2001 From: Will Martin Date: Wed, 27 Nov 2024 09:14:03 -0500 Subject: [PATCH] [PM-15410][PM-15410] add nullish check when referencing `document` in `BrowserPopupUtils` (#12162) * check if document is undefined before accessing `body` --- apps/browser/src/platform/popup/browser-popup-utils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/browser/src/platform/popup/browser-popup-utils.ts b/apps/browser/src/platform/popup/browser-popup-utils.ts index 83fde24ac6..5459c0e220 100644 --- a/apps/browser/src/platform/popup/browser-popup-utils.ts +++ b/apps/browser/src/platform/popup/browser-popup-utils.ts @@ -109,7 +109,10 @@ class BrowserPopupUtils { const defaultPopoutWindowOptions: chrome.windows.CreateData = { type: "popup", focused: true, - width: Math.max(PopupWidthOptions.default, document.body.clientWidth), + width: Math.max( + PopupWidthOptions.default, + typeof document === "undefined" ? PopupWidthOptions.default : document.body.clientWidth, + ), height: 630, }; const offsetRight = 15;