🐛 Fix component variant panel crash with mismatched property counts (#10616)

Use `get` instead of `nth` to avoid index-out-of-bounds when a selected
component copy has fewer variant properties than the first component in
the selection.

Closes #10615

AI-assisted-by: deepseek-v4-pro
This commit is contained in:
Andrey Antukh 2026-07-09 11:01:08 +02:00 committed by GitHub
parent 41ebb8e80b
commit 47a3158602
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -522,7 +522,7 @@
[:*
[:div {:class (stl/css :variant-property-list)}
(for [[pos prop] (map-indexed vector props-first)]
(let [mixed-value? (not-every? #(= (:value prop) (:value (nth % pos))) properties)
(let [mixed-value? (not-every? #(= (:value prop) (:value (get % pos))) properties)
options (get-options (:name prop))
boolean-pair (ctv/find-boolean-pair (mapv :id options))
options (cond-> options