diff options
Diffstat (limited to 'src/StardewModdingAPI.Toolkit/Serialisation/Converters')
-rw-r--r-- | src/StardewModdingAPI.Toolkit/Serialisation/Converters/SemanticVersionConverter.cs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/StardewModdingAPI.Toolkit/Serialisation/Converters/SemanticVersionConverter.cs b/src/StardewModdingAPI.Toolkit/Serialisation/Converters/SemanticVersionConverter.cs index 2075d27e..2ddaa1bf 100644 --- a/src/StardewModdingAPI.Toolkit/Serialisation/Converters/SemanticVersionConverter.cs +++ b/src/StardewModdingAPI.Toolkit/Serialisation/Converters/SemanticVersionConverter.cs @@ -18,7 +18,10 @@ namespace StardewModdingAPI.Toolkit.Serialisation.Converters int minor = obj.ValueIgnoreCase<int>("MinorVersion"); int patch = obj.ValueIgnoreCase<int>("PatchVersion"); string build = obj.ValueIgnoreCase<string>("Build"); - return new LegacyManifestVersion(major, minor, patch, build); + if (build == "0") + build = null; // '0' from incorrect examples in old SMAPI documentation + + return new SemanticVersion(major, minor, patch, build); } /// <summary>Read a JSON string.</summary> |