diff --git a/osu.Game.Tests/Mods/ModUtilsTest.cs b/osu.Game.Tests/Mods/ModUtilsTest.cs
index 7dcaabca3d..7384471c41 100644
--- a/osu.Game.Tests/Mods/ModUtilsTest.cs
+++ b/osu.Game.Tests/Mods/ModUtilsTest.cs
@@ -146,7 +146,7 @@ namespace osu.Game.Tests.Mods
if (isValid)
Assert.IsNull(invalid);
else
- Assert.That(invalid?.Select(t => t.GetType()), Is.EquivalentTo(expectedInvalid));
+ Assert.That(invalid.Select(t => t.GetType()), Is.EquivalentTo(expectedInvalid));
}
public abstract class CustomMod1 : Mod
diff --git a/osu.Game/Utils/ModUtils.cs b/osu.Game/Utils/ModUtils.cs
index 596880f2e7..1c3558fc90 100644
--- a/osu.Game/Utils/ModUtils.cs
+++ b/osu.Game/Utils/ModUtils.cs
@@ -92,7 +92,7 @@ namespace osu.Game.Utils
/// The mods to check.
/// Invalid mods, if any were found. Can be null if all mods were valid.
/// Whether the input mods were all valid. If false, will contain all invalid entries.
- public static bool CheckValidForGameplay(IEnumerable mods, out List? invalidMods)
+ public static bool CheckValidForGameplay(IEnumerable mods, [NotNullWhen(false)] out List? invalidMods)
{
mods = mods.ToArray();