summaryrefslogtreecommitdiff
path: root/src/SMAPI.Toolkit/Serialization/Models/Manifest.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI.Toolkit/Serialization/Models/Manifest.cs')
-rw-r--r--src/SMAPI.Toolkit/Serialization/Models/Manifest.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/SMAPI.Toolkit/Serialization/Models/Manifest.cs b/src/SMAPI.Toolkit/Serialization/Models/Manifest.cs
index 99e85cbd..46b654a5 100644
--- a/src/SMAPI.Toolkit/Serialization/Models/Manifest.cs
+++ b/src/SMAPI.Toolkit/Serialization/Models/Manifest.cs
@@ -1,4 +1,5 @@
using System.Collections.Generic;
+using System.Runtime.Serialization;
using Newtonsoft.Json;
using StardewModdingAPI.Toolkit.Serialization.Converters;
@@ -70,5 +71,14 @@ namespace StardewModdingAPI.Toolkit.Serialization.Models
this.UpdateKeys = new string[0];
this.ContentPackFor = new ManifestContentPackFor { UniqueID = contentPackFor };
}
+
+ /// <summary>Normalize the model after it's deserialized.</summary>
+ /// <param name="context">The deserialization context.</param>
+ [OnDeserialized]
+ public void OnDeserialized(StreamingContext context)
+ {
+ this.Dependencies ??= new IManifestDependency[0];
+ this.UpdateKeys ??= new string[0];
+ }
}
}