summaryrefslogtreecommitdiff
path: root/src/SMAPI.Toolkit/Serialization/Converters/SemanticVersionConverter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI.Toolkit/Serialization/Converters/SemanticVersionConverter.cs')
-rw-r--r--src/SMAPI.Toolkit/Serialization/Converters/SemanticVersionConverter.cs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/SMAPI.Toolkit/Serialization/Converters/SemanticVersionConverter.cs b/src/SMAPI.Toolkit/Serialization/Converters/SemanticVersionConverter.cs
index c32c3185..913d54e0 100644
--- a/src/SMAPI.Toolkit/Serialization/Converters/SemanticVersionConverter.cs
+++ b/src/SMAPI.Toolkit/Serialization/Converters/SemanticVersionConverter.cs
@@ -48,7 +48,12 @@ namespace StardewModdingAPI.Toolkit.Serialization.Converters
return this.ReadObject(JObject.Load(reader));
case JsonToken.String:
- return this.ReadString(JToken.Load(reader).Value<string>(), path);
+ {
+ string? value = JToken.Load(reader).Value<string>();
+ return value is not null
+ ? this.ReadString(value, path)
+ : null;
+ }
default:
throw new SParseException($"Can't parse {nameof(ISemanticVersion)} from {reader.TokenType} node (path: {reader.Path}).");