Skip to content

Commit 6c89be9

Browse files
authored
fix: handle empty dataUrl
1 parent 6cafb3c commit 6c89be9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/exporter/image.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export async function exportToPng(fileNameFormat: string) {
144144
* Chromium will not throw, we can only get an empty canvas
145145
* Firefox will throw "DOMException: CanvasRenderingContext2D.scale: Canvas exceeds max size."
146146
*/
147-
if (!canvas || dataUrl === 'data:,') {
147+
if (!canvas || !dataUrl || dataUrl === 'data:,') {
148148
if (currentPass > passLimit) return null
149149

150150
// 1.4 ^ 5 ~= 5.37, should be enough for most cases

0 commit comments

Comments
 (0)