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 = "";