Allow null values for constructor calls

fixes #10628
This commit is contained in:
Gunnar Beutner 2015-11-14 05:36:48 +01:00
parent 6518f78af0
commit 79b15efd09
1 changed files with 1 additions and 1 deletions

View File

@ -63,7 +63,7 @@ public:
return Convert::ToDouble(value);
else if (type->GetName() == "Boolean")
return Convert::ToBool(value);
else if (!type->IsAssignableFrom(value.GetReflectionType()))
else if (!value.IsEmpty() && !type->IsAssignableFrom(value.GetReflectionType()))
BOOST_THROW_EXCEPTION(ScriptError("Invalid cast: Tried to cast object of type '" + value.GetReflectionType()->GetName() + "' to type '" + type->GetName() + "'", debugInfo));
else
return value;