Skip to content

Commit 7550063

Browse files
authored
Merge pull request #21 from Dini001/patch-1
Deserialize nullable with null value
2 parents 4837da9 + b685001 commit 7550063

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

FileContextCore/Serializer/SerializerHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ static class SerializerHelper
1313
{
1414
public static object Deserialize(this string input, Type type)
1515
{
16-
type = Nullable.GetUnderlyingType(type) ?? type;
17-
1816
if (string.IsNullOrEmpty(input))
1917
{
2018
return type.GetDefaultValue();
2119
}
2220

21+
type = Nullable.GetUnderlyingType(type) ?? type;
22+
2323
if (type == typeof(DateTimeOffset))
2424
{
2525
return DateTimeOffset.Parse(input, CultureInfo.InvariantCulture);

0 commit comments

Comments
 (0)