Disallow registering a null `RulesetStore`

This commit is contained in:
Dean Herbert 2022-02-18 16:48:42 +09:00
parent 420e2c538f
commit cf1dd1ebd3
1 changed files with 3 additions and 2 deletions

View File

@ -5,6 +5,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using JetBrains.Annotations;
using osu.Game.IO;
using osu.Game.Rulesets;
@ -42,9 +43,9 @@ static Decoder()
/// Register dependencies for use with static decoder classes.
/// </summary>
/// <param name="rulesets">A store containing all available rulesets (used by <see cref="LegacyBeatmapDecoder"/>).</param>
public static void RegisterDependencies(RulesetStore rulesets)
public static void RegisterDependencies([NotNull] RulesetStore rulesets)
{
LegacyBeatmapDecoder.RulesetStore = rulesets;
LegacyBeatmapDecoder.RulesetStore = rulesets ?? throw new ArgumentNullException(nameof(rulesets));
}
/// <summary>