From 457a59605c4c0dd3615d9f0911f2b6eb84ab69a4 Mon Sep 17 00:00:00 2001 From: Gaspar Chefdeville Date: Thu, 12 Mar 2026 09:48:19 +0100 Subject: [PATCH] fix: do not iterate on null --- src/css.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/css.ts b/src/css.ts index b4de462e..c1ef9f10 100644 --- a/src/css.ts +++ b/src/css.ts @@ -32,7 +32,7 @@ export function registerCss(module: { default?: string | CSSStyleSheet } | undef fontFaceStyleSheet.insertRule(fontFace) } mainWindow.document.adoptedStyleSheets = [ - ...mainWindow.document.adoptedStyleSheets, + ...(mainWindow.document.adoptedStyleSheets ?? []), fontFaceStyleSheet ] } @@ -55,5 +55,5 @@ export function injectCss(target: HTMLElement) { ) } - root.adoptedStyleSheets = [...root.adoptedStyleSheets, ...sheets] + root.adoptedStyleSheets = [...(root.adoptedStyleSheets ?? []), ...sheets] }