1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 04:02:57 +08:00

Fix tests crashing if a ruleset doesn't provide a NoFail mod

This commit is contained in:
Dean Herbert 2019-09-04 20:28:04 +09:00
parent 3b650ac646
commit c59a2bf9bb

View File

@ -50,7 +50,11 @@ namespace osu.Game.Tests.Visual
Beatmap.Value = CreateWorkingBeatmap(beatmap);
if (!AllowFail)
Mods.Value = new[] { ruleset.GetAllMods().First(m => m is ModNoFail) };
{
var noFailMod = ruleset.GetAllMods().FirstOrDefault(m => m is ModNoFail);
if (noFailMod != null)
Mods.Value = new[] { noFailMod };
}
if (Autoplay)
{