don't crash with index out of range when removing radios from saved play queue
This commit is contained in:
+1
-1
@@ -378,7 +378,7 @@ func (a *App) LoadSavedPlayQueue() error {
|
||||
if err := a.PlaybackManager.LoadTracks(queue.Tracks, Replace, false); err != nil {
|
||||
return err
|
||||
}
|
||||
if queue.TrackIndex >= 0 {
|
||||
if queue.TrackIndex >= 0 && queue.TrackIndex < len(queue.Tracks) {
|
||||
// TODO: This isn't ideal but doesn't seem to cause an audible play-for-a-split-second artifact
|
||||
a.PlaybackManager.PlayTrackAt(queue.TrackIndex)
|
||||
a.PlaybackManager.Pause()
|
||||
|
||||
Reference in New Issue
Block a user