From 230919dd66aa577e840e6847f5a472b86dc1356a Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 26 Mar 2021 15:43:59 +0000 Subject: [PATCH] fix issue with injected styles exploding the theme engine --- src/theme.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/theme.js b/src/theme.js index a413ae74af..40fa291cfc 100644 --- a/src/theme.js +++ b/src/theme.js @@ -176,7 +176,7 @@ export async function setTheme(theme) { for (let i = 0; (a = document.getElementsByTagName("link")[i]); i++) { const href = a.getAttribute("href"); // shouldn't we be using the 'title' tag rather than the href? - const match = href.match(/^bundles\/.*\/theme-(.*)\.css$/); + const match = href && href.match(/^bundles\/.*\/theme-(.*)\.css$/); if (match) { styleElements[match[1]] = a; }