From e0f1f70b820030452c2f32d1d7dfe6417230f9c7 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Mon, 11 Mar 2024 15:52:38 +0900 Subject: [PATCH] Adjust NRT to prevent future issues This way, it will yet at us if the setter is ever moved out of the ctor. --- osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs index a55a55f760..4933eb4041 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs @@ -3,6 +3,7 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics; @@ -79,11 +80,12 @@ namespace osu.Game.Rulesets.Osu.UI NewResult += onNewResult; } - private IHitPolicy hitPolicy = null!; + private IHitPolicy hitPolicy; public IHitPolicy HitPolicy { get => hitPolicy; + [MemberNotNull(nameof(hitPolicy))] set { hitPolicy = value ?? throw new ArgumentNullException(nameof(value));