diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs
index b343998e11..98acd0815d 100644
--- a/osu.Game/Screens/Select/BeatmapCarousel.cs
+++ b/osu.Game/Screens/Select/BeatmapCarousel.cs
@@ -229,11 +229,15 @@ namespace osu.Game.Screens.Select
}
}
- public void SelectNextRandom()
+ ///
+ /// Select the next beatmap in the random sequence.
+ ///
+ /// True if a selection could be made, else False.
+ public bool SelectNextRandom()
{
var visible = beatmapSets.Where(s => !s.Filtered).ToList();
if (!visible.Any())
- return;
+ return false;
if (selectedBeatmap != null)
{
@@ -263,6 +267,7 @@ namespace osu.Game.Screens.Select
set = visible.ElementAt(RNG.Next(visible.Count));
select(set.Beatmaps.Skip(RNG.Next(set.Beatmaps.Count())).FirstOrDefault());
+ return true;
}
public void SelectPreviousRandom()
diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs
index b89a8a4e73..919cfcfbe4 100644
--- a/osu.Game/Screens/Select/SongSelect.cs
+++ b/osu.Game/Screens/Select/SongSelect.cs
@@ -449,9 +449,16 @@ namespace osu.Game.Screens.Select
private void carouselBeatmapsLoaded()
{
if (!Beatmap.IsDefault && Beatmap.Value.BeatmapSetInfo?.DeletePending == false)
+ {
Carousel.SelectBeatmap(Beatmap.Value.BeatmapInfo);
+ }
else if (Carousel.SelectedBeatmapSet == null)
- Carousel.SelectNextRandom();
+ {
+ if (!Carousel.SelectNextRandom())
+ // in the case random selection failed, we want to trigger selectionChanged
+ // to show the dummy beatmap (we have nothing else to display).
+ carouselSelectionChanged(null);
+ }
}
private void delete(BeatmapSetInfo beatmap)