diff --git a/CHANGES.md b/CHANGES.md index d4fae89f5e..efbcd5b866 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -38,6 +38,7 @@ - Fix incorrect query for file versions [Github #8463](https://github.com/penpot/penpot/pull/8463) - Fix warning when clicking on number token pills [Taiga #13661](https://tree.taiga.io/project/penpot/issue/13661) - Fix 'not ISeqable' error when entering float values in layout item and opacity inputs [Github #8569](https://github.com/penpot/penpot/pull/8569) +- Fix crash in select component when options vector is empty [Github #8578](https://github.com/penpot/penpot/pull/8578) ## 2.13.3 diff --git a/frontend/src/app/main/ui/ds/controls/select.cljs b/frontend/src/app/main/ui/ds/controls/select.cljs index 32676bcd36..d40d7275b8 100644 --- a/frontend/src/app/main/ui/ds/controls/select.cljs +++ b/frontend/src/app/main/ui/ds/controls/select.cljs @@ -22,7 +22,8 @@ [options id] (let [options (if (delay? options) @options options)] (or (d/seek #(= id (get % :id)) options) - (nth options 0)))) + (when (seq options) + (nth options 0))))) (defn- get-selected-option-id [options default] @@ -178,7 +179,8 @@ selected-option (mf/with-memo [options selected-id] - (get-option options selected-id)) + (when (d/not-empty? options) + (get-option options selected-id))) label (get selected-option :label)