Merge pull request #8599 from Icinga/bugfux/check-if-cr-is-not-nullptr-while-writing-history-8592

IcingaDB: Check whether or not cr is nullptr
This commit is contained in:
Julian Brost 2021-01-18 18:36:06 +01:00 committed by GitHub
commit 6abab6bddc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1324,7 +1324,7 @@ void IcingaDB::SendSentNotification(
"notification_id", GetObjectIdentifier(notification),
"host_id", GetObjectIdentifier(host),
"type", Convert::ToString(type),
"state", Convert::ToString(service ? Convert::ToLong(cr->GetState()) : Convert::ToLong(Host::CalculateState(cr->GetState()))),
"state", Convert::ToString(cr ? service ? Convert::ToLong(cr->GetState()) : Convert::ToLong(Host::CalculateState(cr->GetState())) : 99),
"previous_hard_state", Convert::ToString(GetPreviousState(checkable, service, StateTypeHard)),
"author", Utility::ValidateUTF8(author),
"text", Utility::ValidateUTF8(finalText),