0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-21 06:02:32 -05:00

Fix trying to update shapes for deleted tokens crash

This commit is contained in:
Florian Schroedl 2024-08-01 11:07:02 +02:00
parent feb438f882
commit cc6f34f78a

View file

@ -55,8 +55,12 @@
[xs resolved-tokens shape]
(-> (reduce
(fn [acc [k v]]
(let [resolved-value (get-in resolved-tokens [v :resolved-value])]
(if (and filter-existing-values? (= (get shape k) resolved-value))
(let [resolved-token (get resolved-tokens v)
resolved-value (get resolved-token :resolved-value)
skip? (or
(not (get resolved-tokens v))
(and filter-existing-values? (= (get shape k) resolved-value)))]
(if skip?
acc
(update acc resolved-value (fnil conj #{}) k))))
{} xs)))