summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Framework/Storage/UploadResult.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI.Web/Framework/Storage/UploadResult.cs')
-rw-r--r--src/SMAPI.Web/Framework/Storage/UploadResult.cs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/SMAPI.Web/Framework/Storage/UploadResult.cs b/src/SMAPI.Web/Framework/Storage/UploadResult.cs
index b1eedd59..92993d42 100644
--- a/src/SMAPI.Web/Framework/Storage/UploadResult.cs
+++ b/src/SMAPI.Web/Framework/Storage/UploadResult.cs
@@ -1,4 +1,4 @@
-#nullable disable
+using System.Diagnostics.CodeAnalysis;
namespace StardewModdingAPI.Web.Framework.Storage
{
@@ -9,25 +9,25 @@ namespace StardewModdingAPI.Web.Framework.Storage
** Accessors
*********/
/// <summary>Whether the file upload succeeded.</summary>
- public bool Succeeded { get; }
+ [MemberNotNullWhen(true, nameof(UploadResult.ID))]
+ [MemberNotNullWhen(false, nameof(UploadResult.UploadError))]
+ public bool Succeeded => this.ID != null && this.UploadError == null;
/// <summary>The file ID, if applicable.</summary>
- public string ID { get; }
+ public string? ID { get; }
/// <summary>The upload error, if any.</summary>
- public string UploadError { get; }
+ public string? UploadError { get; }
/*********
** Public methods
*********/
/// <summary>Construct an instance.</summary>
- /// <param name="succeeded">Whether the file upload succeeded.</param>
/// <param name="id">The file ID, if applicable.</param>
/// <param name="uploadError">The upload error, if any.</param>
- public UploadResult(bool succeeded, string id, string uploadError)
+ public UploadResult(string? id, string? uploadError)
{
- this.Succeeded = succeeded;
this.ID = id;
this.UploadError = uploadError;
}