Commit ebac9d5
committed
fix: harden ColorSelect against empty options
`current` was derived as `options.find(...) ?? options[0]`, which is
`undefined` when callers pass an empty array. Subsequent reads of
`current.icon`/`current.label` then crash the render. This was masked
locally (Svelte's reactive runtime swallows the error on some Node
versions) but surfaced as an unhandled error on Node 20 in CI.
Fall back to a placeholder option object so the button still renders.1 parent 8d938be commit ebac9d5
1 file changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
25 | 34 | | |
26 | 35 | | |
27 | 36 | | |
| |||
0 commit comments