Skip to content

Commit 38fd4e7

Browse files
committed
fix(tui): prevent crash when theme search returns no results
1 parent d251206 commit 38fd4e7

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

packages/opencode/src/cli/cmd/tui/ui/dialog-select.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ export function DialogSelect<T>(props: DialogSelectProps<T>) {
149149

150150
function moveTo(next: number, center = false) {
151151
setStore("selected", next)
152-
props.onMove?.(selected()!)
152+
const option = selected()
153+
if (option) props.onMove?.(option)
153154
if (!scroll) return
154155
const target = scroll.getChildren().find((child) => {
155156
return child.id === JSON.stringify(selected()?.value)

0 commit comments

Comments
 (0)