1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 02:42:54 +08:00

fix for Drawables being empty crashing

This commit is contained in:
FreezyLemon 2017-12-28 03:35:53 +01:00
parent 08e15d63c4
commit 33480b85c8

View File

@ -194,7 +194,11 @@ namespace osu.Game.Screens.Select
if (!Items.Any())
return;
int originalIndex = Items.IndexOf(selectedBeatmap?.Drawables.First());
var d = selectedBeatmap?.Drawables.FirstOrDefault();
if (d == null)
return;
int originalIndex = Items.IndexOf(d);
int currentIndex = originalIndex;
// local function to increment the index in the required direction, wrapping over extremities.