From 102953965e65cab1c7c989cfb5d42285ba4c722b Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 10 Jan 2022 10:27:29 +0000 Subject: [PATCH] null-guard dataset mxTheme to prevent html exports from exploding --- src/utils/exportUtils/exportCSS.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/exportUtils/exportCSS.ts b/src/utils/exportUtils/exportCSS.ts index 9f52edf89a4..ceafed174b4 100644 --- a/src/utils/exportUtils/exportCSS.ts +++ b/src/utils/exportUtils/exportCSS.ts @@ -40,7 +40,7 @@ const getExportCSS = async (usedClasses: Set): Promise => { // only include bundle.css and the data-mx-theme=light styling const stylesheets = Array.from(document.styleSheets).filter(s => { return s.href?.endsWith("bundle.css") || - (s.ownerNode as HTMLStyleElement).dataset.mxTheme.toLowerCase() === "light"; + (s.ownerNode as HTMLStyleElement).dataset.mxTheme?.toLowerCase() === "light"; }); let css = "";