From 061b5338568320183eaab0f116fd97b94888f642 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 30 Apr 2023 13:43:23 -0400 Subject: fix error deserializing null semantic version --- docs/release-notes.md | 1 + src/SMAPI.Toolkit/Serialization/Converters/SemanticVersionConverter.cs | 3 +++ 2 files changed, 4 insertions(+) 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)); -- cgit