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:
commit
c8f8141e9f
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user