Skip to content

Commit

Permalink
fix: handle empty dataUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
pionxzh authored Jun 17, 2024
1 parent 6cafb3c commit 6c89be9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/exporter/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export async function exportToPng(fileNameFormat: string) {
* Chromium will not throw, we can only get an empty canvas
* Firefox will throw "DOMException: CanvasRenderingContext2D.scale: Canvas exceeds max size."
*/
if (!canvas || dataUrl === 'data:,') {
if (!canvas || !dataUrl || dataUrl === 'data:,') {
if (currentPass > passLimit) return null

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

0 comments on commit 6c89be9

Please sign in to comment.