mirror of
https://github.com/penpot/penpot.git
synced 2026-03-26 03:01:16 -04:00
* 🐛 Fix TypeError when token error map lacks :error/fn key Guard against missing :error/fn in token form control resolve streams. When schema validation errors are produced they may not carry an :error/fn key; calling nil as a function caused a TypeError crash. Apply an if-let guard at all 7 affected sites across input.cljs, color_input.cljs and fonts_combobox.cljs, falling back to :message or returning the error map unchanged. * ♻️ Extract token error helpers and add unit tests Extract resolve-error-message and resolve-error-assoc-message helpers into errors.cljs, replacing the seven duplicated inline lambdas in input.cljs, color_input.cljs and fonts_combobox.cljs with named function references. Add frontend-tests.tokens.token-errors-test covering both helpers for the normal path (:error/fn present) and the fallback path (schema-validation errors that lack :error/fn). Signed-off-by: Penpot Dev <dev@penpot.app> --------- Signed-off-by: Penpot Dev <dev@penpot.app>