Skip to content

Commit

Permalink
don't crash if server returns nil saved play queue but no error
Browse files Browse the repository at this point in the history
  • Loading branch information
dweymouth committed Jun 19, 2024
1 parent bc03066 commit 1ed561c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backend/mediaprovider/subsonic/subsonicmediaprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,11 @@ func (s *subsonicMediaProvider) GetPlayQueue() (*mediaprovider.SavedPlayQueue, e
if err != nil {
return nil, err
}

savedQueue := &mediaprovider.SavedPlayQueue{}
if pq == nil {
return savedQueue, nil
}
savedQueue.Tracks = sharedutil.MapSlice(pq.Entries, toTrack)
savedQueue.TrackPos = slices.IndexFunc(pq.Entries, func(e *subsonic.Child) bool {
return e.ID == pq.Current
Expand Down

0 comments on commit 1ed561c

Please sign in to comment.