diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2023-04-30 13:43:23 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2023-04-30 13:43:23 -0400 |
commit | 061b5338568320183eaab0f116fd97b94888f642 (patch) | |
tree | cb934174b8a37753a3be463f0ecd47c97ec47aec | |
parent | c68e922853560dd192edf63004ea4f8f8faf6fba (diff) | |
download | SMAPI-061b5338568320183eaab0f116fd97b94888f642.tar.gz SMAPI-061b5338568320183eaab0f116fd97b94888f642.tar.bz2 SMAPI-061b5338568320183eaab0f116fd97b94888f642.zip |
fix error deserializing null semantic version
-rw-r--r-- | docs/release-notes.md | 1 | ||||
-rw-r--r-- | src/SMAPI.Toolkit/Serialization/Converters/SemanticVersionConverter.cs | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md index 3fbfd990..62402b56 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -15,6 +15,7 @@ * For mod authors: * Added support for [custom update manifests](https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Update_checks#Custom_update_manifest) (thanks to Jamie Taylor!). + * Fixed error loading a mod if it sets `"MinimumApiVersion": null` explicitly. * For SMAPI toolkit users: * Fixed `ModFolder` not being JSON-serializable. diff --git a/src/SMAPI.Toolkit/Serialization/Converters/SemanticVersionConverter.cs b/src/SMAPI.Toolkit/Serialization/Converters/SemanticVersionConverter.cs index 913d54e0..650815b5 100644 --- a/src/SMAPI.Toolkit/Serialization/Converters/SemanticVersionConverter.cs +++ b/src/SMAPI.Toolkit/Serialization/Converters/SemanticVersionConverter.cs @@ -44,6 +44,9 @@ namespace StardewModdingAPI.Toolkit.Serialization.Converters string path = reader.Path; switch (reader.TokenType) { + case JsonToken.Null: + return null; + case JsonToken.StartObject: return this.ReadObject(JObject.Load(reader)); |