We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b5bb4d7 commit 0443865Copy full SHA for 0443865
metagpt/utils/mmdc_playwright.py
@@ -81,10 +81,13 @@ async def console_message(msg):
81
if "svg" in suffixes:
82
svg_xml = await page.evaluate(
83
"""() => {
84
- const svg = document.querySelector('svg');
85
- const xmlSerializer = new XMLSerializer();
86
- return xmlSerializer.serializeToString(svg);
87
- }"""
+ const svg = document.querySelector('svg');
+ if (!svg) {
+ throw new Error('SVG element not found');
+ }
88
+ const xmlSerializer = new XMLSerializer();
89
+ return xmlSerializer.serializeToString(svg);
90
+ }"""
91
)
92
logger.info(f"Generating {output_file_without_suffix}.svg..")
93
with open(f"{output_file_without_suffix}.svg", "wb") as f:
0 commit comments