From f7d19a5746e9f9c092fa2aee492f5d4f5ea62f0e Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 10 Jan 2022 11:34:56 +0000 Subject: [PATCH] null-guard dataset mxTheme to prevent html exports from exploding (#7493) --- 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 9f52edf89a..ceafed174b 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 = "";