From 254a61e2dde3fbf9f40fddf55ba72412c8bac13d Mon Sep 17 00:00:00 2001 From: 3Matvey Date: Wed, 6 May 2026 23:35:20 +0300 Subject: [PATCH] Improve nullable annotations for Result error --- src/Common/ResultPattern/Result.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Common/ResultPattern/Result.cs b/src/Common/ResultPattern/Result.cs index 13e1ed7..dee665e 100644 --- a/src/Common/ResultPattern/Result.cs +++ b/src/Common/ResultPattern/Result.cs @@ -1,4 +1,5 @@ -using System.Text.Json.Serialization; +using System.Diagnostics.CodeAnalysis; +using System.Text.Json.Serialization; namespace Common.ResultPattern; @@ -22,6 +23,7 @@ protected Result() /// The error associated with the failed result. protected Result(Error error) { + ArgumentNullException.ThrowIfNull(error); IsSuccess = false; Error = error; } @@ -29,6 +31,7 @@ protected Result(Error error) /// /// Gets a value indicating whether the result is successful. /// + [MemberNotNullWhen(false, nameof(Error))] public bool IsSuccess { get; } ///