fix(tui): prevent crash when theme search returns no results (#10565)

pull/10566/head
ishaksebsib 2026-01-25 20:11:49 +03:00 committed by GitHub
parent 9407a6fd7c
commit ebe86e40a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -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)