From 4eda1cfb5d547bc62f512cc8fa2e86d4fd73392a Mon Sep 17 00:00:00 2001 From: dwelle Date: Thu, 2 Jan 2020 18:19:00 +0100 Subject: [PATCH] prevent exporting empty canvas --- src/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.js b/src/index.js index c34540a0..21d5d71b 100644 --- a/src/index.js +++ b/src/index.js @@ -34,6 +34,8 @@ function exportAsPNG({ exportVisibleOnly, exportPadding = 10 }) { + if ( !elements.length ) return window.alert("Cannot export empty canvas."); + // deselect & rerender clearSelection();