mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 15:14:07 +02:00
parent
6518f78af0
commit
79b15efd09
@ -63,7 +63,7 @@ public:
|
|||||||
return Convert::ToDouble(value);
|
return Convert::ToDouble(value);
|
||||||
else if (type->GetName() == "Boolean")
|
else if (type->GetName() == "Boolean")
|
||||||
return Convert::ToBool(value);
|
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));
|
BOOST_THROW_EXCEPTION(ScriptError("Invalid cast: Tried to cast object of type '" + value.GetReflectionType()->GetName() + "' to type '" + type->GetName() + "'", debugInfo));
|
||||||
else
|
else
|
||||||
return value;
|
return value;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user