We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bdf2df1 commit b294c3cCopy full SHA for b294c3c
1 file changed
src/Berrysoft.Console/Parser.cs
@@ -31,6 +31,10 @@ private SimpleConverter(Type targetType)
31
}
32
public object Convert(object value)
33
{
34
+ if (value == null)
35
+ {
36
+ return null;
37
+ }
38
return System.Convert.ChangeType(value, targetType);
39
40
public object ConvertBack(object value)
@@ -39,7 +43,7 @@ public object ConvertBack(object value)
43
44
return array;
41
45
42
- return value.ToString();
46
+ return value?.ToString();
47
48
private static Dictionary<Type, ISimpleConverter> converters = new Dictionary<Type, ISimpleConverter>();
49
public static ISimpleConverter Create(Type targetType)
0 commit comments