dweymouth / supersonic

A lightweight and full-featured cross-platform desktop client for self-hosted music servers
GNU General Public License v3.0
675 stars 26 forks source link

Crash when quickly re-searching the All Tracks page #282

Closed dweymouth closed 7 months ago

dweymouth commented 7 months ago

Originally reported in #281

  1. Go to All Tracks, and focus the search bar
  2. Type in "park", Ctrl+A, and type it in again quickly
  3. The app reliably crashes

That results in...

error: Tracklist.trackModelAt: index out of range panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xada02a] goroutine 154 [running]: github.com/dweymouth/supersonic/ui/widgets.(TrackRow).Update(0xc003812f20, 0xc001989ea8?, 0xb) /run/build/supersonic/ui/widgets/tracklist.go:760 +0x2a github.com/dweymouth/supersonic/ui/widgets.NewTracklist.func3(0xa, {0xe44500?, 0xc003812f20}) /run/build/supersonic/ui/widgets/tracklist.go:151 +0x86 fyne.io/fyne/v2/widget.(listLayout).setupListItem(0xc001dd1630, 0xc0000daee0, 0xa, 0x18?) /run/build/supersonic/vendor/fyne.io/fyne/v2/widget/list.go:611 +0xc6 fyne.io/fyne/v2/widget.(listLayout).updateList(0xc001dd1630, 0x0) /run/build/supersonic/vendor/fyne.io/fyne/v2/widget/list.go:698 +0x67b fyne.io/fyne/v2/widget.(List).Resize(0xc0030bca80, {0x0?, 0x0?}) /run/build/supersonic/vendor/fyne.io/fyne/v2/widget/list.go:190 +0x7d fyne.io/fyne/v2/layout.(borderLayout).Layout(0xc001a05f40, {0xc001cbd980, 0x2, 0xc000db6600?}, {0x21ccb00?, 0xc0?}) /run/build/supersonic/vendor/fyne.io/fyne/v2/layout/borderlayout.go:61 +0x4f3 fyne.io/fyne/v2.(Container).layout(...) /run/build/supersonic/vendor/fyne.io/fyne/v2/container.go:195 fyne.io/fyne/v2.(Container).Refresh(0xc001dd1450) /run/build/supersonic/vendor/fyne.io/fyne/v2/container.go:114 +0x47 fyne.io/fyne/v2/internal/widget.(SimpleRenderer).Refresh(0xe468e0?) /run/build/supersonic/vendor/fyne.io/fyne/v2/internal/widget/simple_renderer.go:64 +0x25 fyne.io/fyne/v2/widget.(BaseWidget).Refresh(0xc000db6600?) /run/build/supersonic/vendor/fyne.io/fyne/v2/widget/widget.go:139 +0x26 github.com/dweymouth/supersonic/ui/widgets.(Tracklist).Refresh(...) /run/build/supersonic/ui/widgets/tracklist.go:364 github.com/dweymouth/supersonic/ui/widgets.(*TracklistLoader).loadMoreTracks(0xc001dd14a0, 0x19) /run/build/supersonic/ui/widgets/tracklistloader.go:71 +0x54 created by github.com/dweymouth/supersonic/ui/widgets.NewTracklistLoader in goroutine 153 /run/build/supersonic/ui/widgets/tracklistloader.go:29 +0x187