mirror of
https://github.com/ppy/osu.git
synced 2025-02-11 10:12:58 +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);
|
Beatmap.Value = CreateWorkingBeatmap(beatmap);
|
||||||
|
|
||||||
if (!AllowFail)
|
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)
|
if (Autoplay)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user