Fix #270: crash when removing from currently playing to end of play queue

This commit is contained in:
Drew Weymouth
2023-11-05 08:36:18 -08:00
parent 1c0561de5e
commit d84eeb99c1
+1 -1
View File
@@ -121,7 +121,7 @@ func (p *PlaybackManager) DisableCallbacks() {
// Gets the curently playing song, if any.
func (p *PlaybackManager) NowPlaying() *mediaprovider.Track {
if len(p.playQueue) == 0 || p.player.GetStatus().State == player.Stopped {
if p.nowPlayingIdx < 0 || len(p.playQueue) == 0 || p.player.GetStatus().State == player.Stopped {
return nil
}
return p.playQueue[p.nowPlayingIdx]