From 2c8236e7c2ab636f380d0ceb916241c9cdb00805 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Fri, 21 Oct 2022 18:08:49 -0700 Subject: [PATCH] Fix error setting node. --- packages/mindplot/src/components/Topic.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/mindplot/src/components/Topic.ts b/packages/mindplot/src/components/Topic.ts index fd65a945..071e76dc 100644 --- a/packages/mindplot/src/components/Topic.ts +++ b/packages/mindplot/src/components/Topic.ts @@ -746,7 +746,8 @@ abstract class Topic extends NodeGraph { const model = this.getModel(); const dispatcher = ActionDispatcher.getInstance(); const notes = model.findFeatureByType(TopicFeatureFactory.Note.id); - if (!$defined(value)) { + + if (!$defined(value) && notes.length > 0) { const featureId = notes[0].getId(); dispatcher.removeFeatureFromTopic(topicId, featureId); } else if (notes.length > 0) {