mirror of https://github.com/Icinga/icinga2.git
Fix: missing check_command attribute results in sigsegv on check execution
Fixes #4331
This commit is contained in:
parent
2b1c268ecd
commit
b0ac607caf
|
@ -50,6 +50,8 @@ type Host {
|
|||
%attribute string "*"
|
||||
},
|
||||
|
||||
%attribute name(CheckCommand) "check_command",
|
||||
|
||||
%attribute name(TimePeriod) "check_period",
|
||||
%attribute number "check_interval",
|
||||
%attribute number "retry_interval",
|
||||
|
|
|
@ -582,7 +582,12 @@ void Service::ExecuteCheck(void)
|
|||
Dictionary::Ptr result;
|
||||
|
||||
try {
|
||||
result = GetCheckCommand()->Execute(GetSelf());
|
||||
CheckCommand::Ptr command = GetCheckCommand();
|
||||
|
||||
if (!command)
|
||||
return;
|
||||
|
||||
result = command->Execute(GetSelf());
|
||||
} catch (const std::exception& ex) {
|
||||
std::ostringstream msgbuf;
|
||||
msgbuf << "Exception occured during check for service '"
|
||||
|
|
Loading…
Reference in New Issue