Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

prevent exporting empty canvas

dwelle4eda1cfb5d54
diff --git a/src/index.js b/src/index.js
index c34540a00f..21d5d71b25 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();