1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 18:03:11 +08:00

Use ArgumentNullException.ThrowIfNull in more places

This commit is contained in:
Berkan Diler 2024-03-05 10:19:47 +01:00
parent 43841e210d
commit 9bac60a98f

View File

@ -135,8 +135,7 @@ namespace osu.Game.Rulesets.UI
protected DrawableRuleset(Ruleset ruleset, IBeatmap beatmap, IReadOnlyList<Mod> mods = null)
: base(ruleset)
{
if (beatmap == null)
throw new ArgumentNullException(nameof(beatmap), "Beatmap cannot be null.");
ArgumentNullException.ThrowIfNull(beatmap);
if (!(beatmap is Beatmap<TObject> tBeatmap))
throw new ArgumentException($"{GetType()} expected the beatmap to contain hitobjects of type {typeof(TObject)}.", nameof(beatmap));