From a5dd8f3726bfd9e8fd40f5703ea38e0d6d087812 Mon Sep 17 00:00:00 2001 From: bordun Date: Mon, 22 Mar 2021 08:29:38 +0100 Subject: [PATCH] editor: error when duplicating widget while if the clipboard is empty --- CHANGELOG.md | 5 +++++ src/client/editor/index.js | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a92a65d8..ae8a507e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 1.8.15 + +- bug fixes + - editor: error when duplicating widget while if the clipboard is empty + ## 1.8.14 - bug fixes diff --git a/src/client/editor/index.js b/src/client/editor/index.js index 3c863191..c69e9aea 100644 --- a/src/client/editor/index.js +++ b/src/client/editor/index.js @@ -589,10 +589,12 @@ class Editor { pasteWidget(x, y, increment, index, tmp) { - if (!this.selectedWidgets.length || this.clipboard === null) return + if (!this.selectedWidgets.length) return var clipboard = tmp ? this.tmpClipboard : this.clipboard + if (clipboard === null) return + if ( this.selectedWidgets[0].childrenType === undefined || clipboard[0].type === 'tab' && this.selectedWidgets[0].childrenType === 'widget' ||