Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IcingaDB: Check whether or not cr is nullptr #8599

Conversation

yhabteab
Copy link
Member

resolves #8592

@icinga-probot icinga-probot bot added this to the 2.13.0 milestone Jan 18, 2021
@icinga-probot icinga-probot bot added area/icingadb New backend core/crash Shouldn't happen, requires attention labels Jan 18, 2021
@yhabteab yhabteab requested a review from Al2Klimov January 18, 2021 10:41
@Al2Klimov Al2Klimov requested a review from julianbrost January 18, 2021 10:43
@@ -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),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've already seen this magic 99 appear elsewhere in the code. Is there really no constant for this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly. (If it already appears multiple times, I consider it another construction area.)

@Al2Klimov Al2Klimov requested a review from julianbrost January 18, 2021 11:25
@julianbrost julianbrost merged commit 6abab6b into master Jan 18, 2021
@icinga-probot icinga-probot bot deleted the bugfux/check-if-cr-is-not-nullptr-while-writing-history-8592 branch January 18, 2021 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/icingadb New backend core/crash Shouldn't happen, requires attention
Projects
None yet
Development

Successfully merging this pull request may close these issues.

intrusive_ptr assertion failed in Icinga DB while modifying objects using the API
3 participants