Fix crash when switching tracks back and forth with shuffle on

This commit is contained in:
Bartłomiej Dach 2024-10-11 12:45:14 +02:00
parent 1a25e9d179
commit 4a16341a94
No known key found for this signature in database
1 changed files with 6 additions and 3 deletions

View File

@ -397,10 +397,13 @@ private bool next(bool allowProtectedTracks)
randomHistoryDirection += direction;
}
if (previousRandomSets.Count > 0)
{
result = previousRandomSets[^1];
previousRandomSets.RemoveAt(previousRandomSets.Count - 1);
return result;
}
}
// if the early-return above didn't cover it, it means that we have no history to fall back on
// and need to actually choose something random.