From b3b183c1517192da04a7c7c3b03952c97cc551a6 Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Mon, 18 Aug 2025 16:52:52 +0200 Subject: [PATCH] :bug: Fix duplicate a variant when all have bad formulae crashes --- common/src/app/common/logic/variants.cljc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/common/src/app/common/logic/variants.cljc b/common/src/app/common/logic/variants.cljc index 936c3d9f4a..e8c14d5405 100644 --- a/common/src/app/common/logic/variants.cljc +++ b/common/src/app/common/logic/variants.cljc @@ -31,9 +31,11 @@ component-id new-component-id {:new-shape-id new-shape-id :apply-changes-local-library? true}))] - (-> changes - (clvp/generate-update-property-value new-component-id prop-num value) - (pcb/change-parent (:parent-id shape) [new-shape] 0)))) + (cond-> changes + (>= prop-num 0) + (clvp/generate-update-property-value new-component-id prop-num value) + :always + (pcb/change-parent (:parent-id shape) [new-shape] 0)))) (defn- generate-path [path objects base-id shape]