From f790b7699da21846b6183fe020f06a1d795880a6 Mon Sep 17 00:00:00 2001 From: Mattia Codato Date: Fri, 31 Jul 2020 08:53:10 +0200 Subject: [PATCH] Check if last check result is null before executing the command --- lib/icinga/apiactions.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/icinga/apiactions.cpp b/lib/icinga/apiactions.cpp index 02b0e451d..842834108 100644 --- a/lib/icinga/apiactions.cpp +++ b/lib/icinga/apiactions.cpp @@ -637,6 +637,8 @@ Dictionary::Ptr ApiActions::ExecuteCommand(const ConfigObject::Ptr& object, ); CheckResult::Ptr cr = checkable->GetLastCheckResult(); + if (!cr) + cr = new CheckResult(); /* Check if resolved_command exists and it is of type command_type */ Dictionary::Ptr execMacros = new Dictionary();