Skip to content

Commit 333e999

Browse files
Support Nullable<> as ConCmd argument (#3515)
Co-authored-by: 766974616c79 <100430077+766974616c79@users.noreply.github.com>
1 parent 95a575e commit 333e999

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

engine/Sandbox.System/Extend/StringExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,7 @@ public static bool TryToType( this string str, Type t, out object Value )
614614
{
615615
Value = null;
616616

617+
t = Nullable.GetUnderlyingType( t ) ?? t;
617618
if ( t == typeof( decimal ) ) { Value = str.ToDecimal(); return true; }
618619
if ( t == typeof( float ) ) { Value = str.ToFloat(); return true; }
619620
if ( t == typeof( double ) ) { Value = (double)str.ToFloat(); return true; }

0 commit comments

Comments
 (0)