mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
parent
6518f78af0
commit
79b15efd09
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user