Use dynamic_pointer_cast

This commit is contained in:
Mattia Codato 2020-06-30 15:41:47 +02:00
parent 94be948ff6
commit 5c06256ac5
1 changed files with 2 additions and 2 deletions

View File

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