From 5b0bbd635135e2947cd06452238856e9ecf5678c Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Mon, 18 Jan 2021 11:38:31 +0100 Subject: [PATCH] IcingaDB: Check whether or not cr is nullptr --- lib/icingadb/icingadb-objects.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/icingadb/icingadb-objects.cpp b/lib/icingadb/icingadb-objects.cpp index 228ae71ba..c541a7552 100644 --- a/lib/icingadb/icingadb-objects.cpp +++ b/lib/icingadb/icingadb-objects.cpp @@ -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),