defensive nil checks around CanvasForObject

This commit is contained in:
Drew Weymouth
2026-03-01 08:24:16 -08:00
parent 12b5d33bbe
commit afb1c6c397
8 changed files with 30 additions and 13 deletions
+3 -1
View File
@@ -392,7 +392,9 @@ func NewPlaylistPageHeader(page *PlaylistPage) *PlaylistPageHeader {
}
buttonRow.Objects[3] = searchEntry
searchEntry.SetMinWidth(minW)
fyne.CurrentApp().Driver().CanvasForObject(a).Focus(searchEntry)
if c := fyne.CurrentApp().Driver().CanvasForObject(a); c != nil {
c.Focus(searchEntry)
}
fyne.NewAnimation(myTheme.AnimationDurationShort, func(f float32) {
w := (200-minW)*f + minW
searchEntry.SetMinWidth(w)