Skip to content

Commit 11144ff

Browse files
committed
fix
1 parent d395b21 commit 11144ff

File tree

1 file changed

+6
-3
lines changed
  • packages/docs/src/components

1 file changed

+6
-3
lines changed

packages/docs/src/components/d2.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ document.querySelectorAll(".d2.shadow").forEach(async (container: Element) => {
1717
);
1818
container = iframe.contentDocument!.querySelector("svg")! as Element;
1919
const styleSheet = iframe.contentDocument!.styleSheets[0];
20-
css
21-
.split("\n")
22-
.forEach((row) => styleSheet.insertRule(row, styleSheet.cssRules.length));
20+
if (styleSheet)
21+
css
22+
.split("\n")
23+
.forEach((row) =>
24+
styleSheet.insertRule(row, styleSheet.cssRules.length)
25+
);
2326
}
2427

2528
if (!data) return;

0 commit comments

Comments
 (0)