From 74a8aea72c6e78c3325548f96ce85289c564e8b9 Mon Sep 17 00:00:00 2001 From: Drew Weymouth Date: Sun, 18 Feb 2024 09:00:13 -0800 Subject: [PATCH] fix nil ptr crash when switching to favorite songs view --- ui/widgets/tracklist.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/widgets/tracklist.go b/ui/widgets/tracklist.go index 400cd9c8..d33f6848 100644 --- a/ui/widgets/tracklist.go +++ b/ui/widgets/tracklist.go @@ -321,7 +321,9 @@ func (t *Tracklist) SetTracks(trs []*mediaprovider.Track) { func (t *Tracklist) _setTracks(trs []*mediaprovider.Track) { t.tracksMutex.Lock() defer t.tracksMutex.Unlock() - t.list.ClearItemForIDMap() + if t.list != nil { + t.list.ClearItemForIDMap() + } t.tracksOrigOrder = toTrackModels(trs) t.doSortTracks() }