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

Fix tests crashing if a ruleset doesn't provide a NoFail mod (#5989)

Fix tests crashing if a ruleset doesn't provide a NoFail mod
This commit is contained in:
Dean Herbert 2019-09-05 14:18:03 +09:00 committed by GitHub
commit c8f8141e9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)
{