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
@@ -124,7 +124,9 @@ func NewVolumeSlider(width float32) *volumeSlider {
func (v *volumeSlider) Tapped(e *fyne.PointEvent) {
v.Slider.Tapped(e)
fyne.CurrentApp().Driver().CanvasForObject(v).Unfocus()
if c := fyne.CurrentApp().Driver().CanvasForObject(v); c != nil {
c.Unfocus()
}
}
func (v *volumeSlider) MinSize() fyne.Size {