diff options
| author | ishaksebsib <[email protected]> | 2026-01-25 20:11:49 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-01-25 12:11:49 -0500 |
| commit | ebe86e40a0d97a07283e4c6323ab3ba082623504 (patch) | |
| tree | 1d9d6ddc407bd79b49594420ee88c93765d95b5b /packages | |
| parent | 9407a6fd7c1e844a88ba409504f0ccf8c9013c74 (diff) | |
| download | opencode-ebe86e40a0d97a07283e4c6323ab3ba082623504.tar.gz opencode-ebe86e40a0d97a07283e4c6323ab3ba082623504.zip | |
fix(tui): prevent crash when theme search returns no results (#10565)
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/opencode/src/cli/cmd/tui/ui/dialog-select.tsx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/opencode/src/cli/cmd/tui/ui/dialog-select.tsx b/packages/opencode/src/cli/cmd/tui/ui/dialog-select.tsx index 404fbae10..8ff5a3b23 100644 --- a/packages/opencode/src/cli/cmd/tui/ui/dialog-select.tsx +++ b/packages/opencode/src/cli/cmd/tui/ui/dialog-select.tsx @@ -149,7 +149,8 @@ export function DialogSelect<T>(props: DialogSelectProps<T>) { function moveTo(next: number, center = false) { setStore("selected", next) - props.onMove?.(selected()!) + const option = selected() + if (option) props.onMove?.(option) if (!scroll) return const target = scroll.getChildren().find((child) => { return child.id === JSON.stringify(selected()?.value) |
