[PM-15410][PM-15410] add nullish check when referencing `document` in `BrowserPopupUtils` (#12162)

* check if document is undefined before accessing `body`
This commit is contained in:
Will Martin 2024-11-27 09:14:03 -05:00 committed by GitHub
parent d5b14d11d4
commit d448db5ed7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -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;