🐛 Fix crash when editing tokens with group nodes

Make sd-token-uuid nil-safe when accessing .original.id to prevent
crashes when StyleDictionary emits group nodes alongside real tokens.

Group nodes have an original object but no id property, causing
undefined is not an object errors during interactive token resolution
in the edit modal.

Closes #11143

AI-assisted-by: qwen3.7-plus
This commit is contained in:
Andrey Antukh 2026-08-08 13:53:06 +00:00
parent 2f04fcddbf
commit b0b6ed30f5

View File

@ -557,7 +557,8 @@
(.. sd-token -original -name))
(defn sd-token-uuid [^js sd-token]
(uuid (.-uuid (.. sd-token -original -id))))
(when-let [id (.. sd-token -original -id)]
(uuid (.-uuid id))))
(defn- merge-name-collisions
"Re-attach tokens that `ctob/tokens-tree` / `backtrace-tokens-tree`