Skip to content

Commit b294c3c

Browse files
committed
!!Big bug!!
1 parent bdf2df1 commit b294c3c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/Berrysoft.Console/Parser.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ private SimpleConverter(Type targetType)
3131
}
3232
public object Convert(object value)
3333
{
34+
if (value == null)
35+
{
36+
return null;
37+
}
3438
return System.Convert.ChangeType(value, targetType);
3539
}
3640
public object ConvertBack(object value)
@@ -39,7 +43,7 @@ public object ConvertBack(object value)
3943
{
4044
return array;
4145
}
42-
return value.ToString();
46+
return value?.ToString();
4347
}
4448
private static Dictionary<Type, ISimpleConverter> converters = new Dictionary<Type, ISimpleConverter>();
4549
public static ISimpleConverter Create(Type targetType)

0 commit comments

Comments
 (0)