mirror of https://github.com/Icinga/icinga2.git
Check !!downtime->GetCheckable() before downtime->GetCheckable()->GetName()
... not to crash while removing a downtime from a disappeared checkable.
This commit is contained in:
parent
e9b8fc234b
commit
8b0ba2275a
|
@ -345,10 +345,19 @@ void Downtime::RemoveDowntime(const String& id, bool cancelled, bool expired, co
|
|||
reason = "<unknown>";
|
||||
}
|
||||
|
||||
Log(LogInformation, "Downtime")
|
||||
<< "Removed downtime '" << downtime->GetName() << "' from checkable '"
|
||||
<< downtime->GetCheckable()->GetName() << "' (Reason: " << reason << ").";
|
||||
Log msg (LogInformation, "Downtime");
|
||||
|
||||
msg << "Removed downtime '" << downtime->GetName() << "' from checkable";
|
||||
|
||||
{
|
||||
auto checkable (downtime->GetCheckable());
|
||||
|
||||
if (checkable) {
|
||||
msg << " '" << checkable->GetName() << "'";
|
||||
}
|
||||
}
|
||||
|
||||
msg << " (Reason: " << reason << ").";
|
||||
}
|
||||
|
||||
bool Downtime::CanBeTriggered()
|
||||
|
|
Loading…
Reference in New Issue