From e0350b28376fb923ee571925c089546db6295201 Mon Sep 17 00:00:00 2001 From: Saud Fatayerji Date: Mon, 8 May 2023 12:36:39 +0300 Subject: [PATCH] Fixed error when clicking the delete draggable element with none available. --- src/main/resources/static/js/draggable-utils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/resources/static/js/draggable-utils.js b/src/main/resources/static/js/draggable-utils.js index 07437f7b..bd91093e 100644 --- a/src/main/resources/static/js/draggable-utils.js +++ b/src/main/resources/static/js/draggable-utils.js @@ -113,7 +113,9 @@ const DraggableUtils = { }) }, deleteDraggableCanvas(element) { - element.remove(); + if (element) { + element.remove(); + } }, deleteDraggableCanvasById(id) { this.deleteDraggableCanvas(document.getElementById(id));