From 953287ea33800aebd5e04757fa8e71e4c54ee651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Tue, 1 Jul 2025 09:48:51 +0200 Subject: [PATCH] :bug: Avoid crash in combobox with empty options --- frontend/src/app/main/ui/ds/controls/combobox.cljs | 6 ++++-- .../app/main/ui/workspace/tokens/themes/create_modal.cljs | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/ui/ds/controls/combobox.cljs b/frontend/src/app/main/ui/ds/controls/combobox.cljs index 98805119c6..2cd6dbc478 100644 --- a/frontend/src/app/main/ui/ds/controls/combobox.cljs +++ b/frontend/src/app/main/ui/ds/controls/combobox.cljs @@ -206,10 +206,12 @@ selected-option (mf/with-memo [options selected-id] - (get-option options selected-id)) + (when (d/not-empty? options) + (get-option options selected-id))) icon - (get selected-option :icon)] + (when selected-option + (get selected-option :icon))] (mf/with-effect [dropdown-options] (mf/set-ref-val! options-ref dropdown-options)) diff --git a/frontend/src/app/main/ui/workspace/tokens/themes/create_modal.cljs b/frontend/src/app/main/ui/workspace/tokens/themes/create_modal.cljs index 570b9f97e2..8bae6baaf0 100644 --- a/frontend/src/app/main/ui/workspace/tokens/themes/create_modal.cljs +++ b/frontend/src/app/main/ui/workspace/tokens/themes/create_modal.cljs @@ -172,6 +172,7 @@ {:label group :id group}) theme-groups) + on-update-group (mf/use-fn (mf/deps on-change-field)