fix for Drawables being empty crashing

This commit is contained in:
FreezyLemon 2017-12-28 03:35:53 +01:00
parent 08e15d63c4
commit 33480b85c8
1 changed files with 5 additions and 1 deletions

View File

@ -194,7 +194,11 @@ public void SelectNext(int direction = 1, bool skipDifficulties = true)
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.