null-guard dataset mxTheme to prevent html exports from exploding (#7493)

pull/21833/head
Michael Telatynski 2022-01-10 11:34:56 +00:00 committed by GitHub
parent 31ab91359a
commit f7d19a5746
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -40,7 +40,7 @@ const getExportCSS = async (usedClasses: Set<string>): Promise<string> => {
// 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 = "";