Merge pull request #7287 from Icinga/bugfix/script-debugger-crash-7284

Service: don't rely on the own host being already set during derivative state calculation
This commit is contained in:
Michael Friedrich 2019-07-08 09:31:15 +02:00 committed by GitHub
commit fdaab4b420
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -125,7 +125,7 @@ int Service::GetSeverity() const
severity |= SeverityFlagDowntime; severity |= SeverityFlagDowntime;
else if (IsAcknowledged()) else if (IsAcknowledged())
severity |= SeverityFlagAcknowledgement; severity |= SeverityFlagAcknowledgement;
else if (m_Host->GetProblem()) else if (m_Host && m_Host->GetProblem())
severity |= SeverityFlagHostDown; severity |= SeverityFlagHostDown;
else else
severity |= SeverityFlagUnhandled; severity |= SeverityFlagUnhandled;
@ -137,7 +137,7 @@ int Service::GetSeverity() const
bool Service::GetHandled() const bool Service::GetHandled() const
{ {
return Checkable::GetHandled() || m_Host->GetProblem(); return Checkable::GetHandled() || (m_Host && m_Host->GetProblem());
} }
bool Service::IsStateOK(ServiceState state) const bool Service::IsStateOK(ServiceState state) const