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
@@ -50,7 +50,9 @@ func (t *TrackPosSlider) Tapped(e *fyne.PointEvent) {
t.Slider.Tapped(e)
// don't keep focus after being tapped
fyne.CurrentApp().Driver().CanvasForObject(t).Focus(nil)
if c := fyne.CurrentApp().Driver().CanvasForObject(t); c != nil {
c.Unfocus()
}
}
// override to increase the distance moved by keyboard control