🐛 Guard against nil variant-data in typography-item

When d/seek finds no matching font variant (e.g. the variant-id stored
on the typography no longer exists in the font's variants list),
variant-data is nil and (:name nil) produces nil, resulting in a
malformed label like "14px | ". Fall back to "--" in that case.
This commit is contained in:
Andrey Antukh 2026-04-14 18:43:45 +00:00 committed by Belén Albeza
parent e8547ab6dd
commit 8f30a95ca0

View File

@ -64,7 +64,7 @@
[:div {:class (stl/css :typography-font)}
(:name font-data)]
[:div {:class (stl/css :typography-data)}
(str (:font-size typography) "px | " (:name variant-data))]]))
(str (:font-size typography) "px | " (or (:name variant-data) "--"))]]))
(mf/defc palette*
[{:keys [selected selected-ids current-file-id file-typographies libraries size width]}]