1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 17:47:29 +08:00

Fix test not handling 0 beatmap sets

This commit is contained in:
Salman Ahmed 2021-05-08 13:03:50 +03:00
parent dca5efc59a
commit 26c0010fe6

View File

@ -68,6 +68,9 @@ namespace osu.Game.Tests.Visual.SongSelect
createDisplay(() =>
{
var allBeatmapSets = manager.GetAllUsableBeatmapSets(IncludedDetails.Minimal);
if (allBeatmapSets.Count == 0)
return manager.DefaultBeatmap;
var randomBeatmapSet = allBeatmapSets[RNG.Next(0, allBeatmapSets.Count - 1)];
var randomBeatmap = randomBeatmapSet.Beatmaps[RNG.Next(0, randomBeatmapSet.Beatmaps.Count - 1)];