Fix passing nil to CSharp functions not returning function

This commit is contained in:
Deukhoofd 2018-12-09 18:13:19 +01:00
parent beac043995
commit 50f06f389a
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
1 changed files with 9 additions and 0 deletions

View File

@ -82,6 +82,11 @@ namespace Upsilon.BaseTypes.UserData
continue;
}
if (argumentType == typeof(ScriptNull))
{
continue;
}
if (!matchParameter.ParameterType.IsAssignableFrom(argumentType))
{
validMatch = false;
@ -144,6 +149,10 @@ namespace Upsilon.BaseTypes.UserData
break;
}
if (value is ScriptNull)
{
return null;
}
var isScriptTypeRequired = typeof(ScriptType).IsAssignableFrom(type);
var isScriptType = value is ScriptType;