Use dynamic_pointer_cast

This commit is contained in:
Mattia Codato 2020-06-30 15:41:47 +02:00
parent 94be948ff6
commit 5c06256ac5

View File

@ -556,7 +556,7 @@ Dictionary::Ptr ApiActions::GenerateTicket(const ConfigObject::Ptr&,
Dictionary::Ptr ApiActions::ExecuteCommand(const ConfigObject::Ptr& object, Dictionary::Ptr ApiActions::ExecuteCommand(const ConfigObject::Ptr& object,
const Dictionary::Ptr& params) const Dictionary::Ptr& params)
{ {
Checkable::Ptr checkable = static_pointer_cast<Checkable>(object); Checkable::Ptr checkable = dynamic_pointer_cast<Checkable>(object);
if (!checkable) if (!checkable)
return ApiActions::CreateResult(404, "Can't schedule a command execution for non-existent object."); return ApiActions::CreateResult(404, "Can't schedule a command execution for non-existent object.");