summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI.Toolkit/Serialisation/Converters/SemanticVersionConverter.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-06-05 23:03:26 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-06-05 23:03:26 -0400
commit6eba10948bf39d5e05505ec060f6920f84610d58 (patch)
tree24fbaade58c3909127353d2d4fd1ce2dadec0727 /src/StardewModdingAPI.Toolkit/Serialisation/Converters/SemanticVersionConverter.cs
parent3c06a496a0255106076b4f6ade3ed9019dbda4f3 (diff)
downloadSMAPI-6eba10948bf39d5e05505ec060f6920f84610d58.tar.gz
SMAPI-6eba10948bf39d5e05505ec060f6920f84610d58.tar.bz2
SMAPI-6eba10948bf39d5e05505ec060f6920f84610d58.zip
fix version parsing issues in new toolkit code (#532)
Diffstat (limited to 'src/StardewModdingAPI.Toolkit/Serialisation/Converters/SemanticVersionConverter.cs')
-rw-r--r--src/StardewModdingAPI.Toolkit/Serialisation/Converters/SemanticVersionConverter.cs5
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>