From a5698d5fdee6079a09022a9d891d8cfcc3b68e12 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 65f462499..fa5fdf7a2 100644 --- a/lib/icinga/apiactions.cpp +++ b/lib/icinga/apiactions.cpp @@ -667,6 +667,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();