mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 23:24:09 +02:00
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>";
|
reason = "<unknown>";
|
||||||
}
|
}
|
||||||
|
|
||||||
Log(LogInformation, "Downtime")
|
Log msg (LogInformation, "Downtime");
|
||||||
<< "Removed downtime '" << downtime->GetName() << "' from checkable '"
|
|
||||||
<< downtime->GetCheckable()->GetName() << "' (Reason: " << reason << ").";
|
|
||||||
|
|
||||||
|
msg << "Removed downtime '" << downtime->GetName() << "' from checkable";
|
||||||
|
|
||||||
|
{
|
||||||
|
auto checkable (downtime->GetCheckable());
|
||||||
|
|
||||||
|
if (checkable) {
|
||||||
|
msg << " '" << checkable->GetName() << "'";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
msg << " (Reason: " << reason << ").";
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Downtime::CanBeTriggered()
|
bool Downtime::CanBeTriggered()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user