summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-02-17 13:59:31 -0500
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-02-17 13:59:31 -0500
commite321362378eaacd0081db44f0db3ef457ef97368 (patch)
tree79f855841bb65f8f55cc18f761767415386abff6 /src/StardewModdingAPI
parent41ee8990f81a63c686953b2c28e7af8627fd8098 (diff)
downloadSMAPI-e321362378eaacd0081db44f0db3ef457ef97368.tar.gz
SMAPI-e321362378eaacd0081db44f0db3ef457ef97368.tar.bz2
SMAPI-e321362378eaacd0081db44f0db3ef457ef97368.zip
fix nullable enums not being written to JSON as string
Diffstat (limited to 'src/StardewModdingAPI')
-rw-r--r--src/StardewModdingAPI/Framework/Serialisation/SelectiveStringEnumConverter.cs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/StardewModdingAPI/Framework/Serialisation/SelectiveStringEnumConverter.cs b/src/StardewModdingAPI/Framework/Serialisation/SelectiveStringEnumConverter.cs
index e9c5496d..37108556 100644
--- a/src/StardewModdingAPI/Framework/Serialisation/SelectiveStringEnumConverter.cs
+++ b/src/StardewModdingAPI/Framework/Serialisation/SelectiveStringEnumConverter.cs
@@ -29,7 +29,9 @@ namespace StardewModdingAPI.Framework.Serialisation
/// <param name="type">The object type.</param>
public override bool CanConvert(Type type)
{
- return base.CanConvert(type) && this.Types.Contains(type.FullName);
+ return
+ base.CanConvert(type)
+ && this.Types.Contains((Nullable.GetUnderlyingType(type) ?? type).FullName);
}
}
}