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:
parent
3b650ac646
commit
c59a2bf9bb
@ -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