From b30036a424e6fb8bbad5fe17f641b6abc39d155a Mon Sep 17 00:00:00 2001 From: cuixiping Date: Tue, 14 Jan 2020 10:57:24 +0800 Subject: [PATCH] Fix: Pressing 'Ctrl+A' causes js error when canvas is empty --- editor/svgcanvas.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 77c860dd..04edf2a9 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -687,6 +687,9 @@ const addToSelection = this.addToSelection = function (elemsToAdd, showGrips) { } } } + if (!selectedElements.length) { + return; + } call('selected', selectedElements); if (showGrips || selectedElements.length === 1) {