From 3a4949a77be2b459a6df4b244904315971fa8cd5 Mon Sep 17 00:00:00 2001 From: Markus Hesper Date: Wed, 24 Jun 2026 18:03:11 +0200 Subject: [PATCH] fix(GlobalStylesStore): add nullish checks for `ownerNode` to prevent potential runtime errors --- src/util/GlobalStylesStore.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/GlobalStylesStore.js b/src/util/GlobalStylesStore.js index 475fe31..04cd988 100644 --- a/src/util/GlobalStylesStore.js +++ b/src/util/GlobalStylesStore.js @@ -54,13 +54,13 @@ class GlobalStylesStore extends Store { } // if it does not exist yet -> build it - if (styleSheet.ownerNode.tagName === 'STYLE') { + if (styleSheet.ownerNode?.tagName === 'STYLE') { const cssStyleSheet = new CSSStyleSheet({ media: styleSheet.media, disabled: styleSheet.disabled }); cssStyleSheet.replaceSync(styleSheet.ownerNode.textContent); this.globalStyleSheetsCache.set(styleSheet.ownerNode, cssStyleSheet); this.requestUpdate(); - } else if (styleSheet.ownerNode.tagName === 'LINK') { + } else if (styleSheet.ownerNode?.tagName === 'LINK') { const cssStyleSheet = new CSSStyleSheet({ baseURL: styleSheet.href, media: styleSheet.media,