diff --git a/lib/icinga/checkable-notification.cpp b/lib/icinga/checkable-notification.cpp index fae30137b..6404bb50a 100644 --- a/lib/icinga/checkable-notification.cpp +++ b/lib/icinga/checkable-notification.cpp @@ -75,7 +75,7 @@ void Checkable::SendNotifications(NotificationType type, const CheckResult::Ptr& << "Notification '" << notification->GetName() << "': there are some stashed notifications. Stashing notification to preserve order."; stashedNotifications->Add(new Dictionary({ - {"type", type}, + {"notification_type", type}, {"cr", cr}, {"force", force}, {"reminder", false}, @@ -100,7 +100,7 @@ void Checkable::SendNotifications(NotificationType type, const CheckResult::Ptr& << "Notification '" << notification->GetName() << "': object authority hasn't been updated, yet. Stashing notification."; notification->GetStashedNotifications()->Add(new Dictionary({ - {"type", type}, + {"notification_type", type}, {"cr", cr}, {"force", force}, {"reminder", false}, diff --git a/lib/notification/notificationcomponent.cpp b/lib/notification/notificationcomponent.cpp index 55e95b9dd..53fcffe78 100644 --- a/lib/notification/notificationcomponent.cpp +++ b/lib/notification/notificationcomponent.cpp @@ -183,12 +183,15 @@ void NotificationComponent::NotificationTimerHandler() ObjectLock olock(unstashedNotifications); for (Dictionary::Ptr unstashedNotification : unstashedNotifications) { + if (!unstashedNotification) + continue; + try { Log(LogNotice, "NotificationComponent") << "Attempting to send stashed notification '" << notificationName << "'."; notification->BeginExecuteNotification( - (NotificationType)(int)unstashedNotification->Get("type"), + (NotificationType)(int)unstashedNotification->Get("notification_type"), (CheckResult::Ptr)unstashedNotification->Get("cr"), (bool)unstashedNotification->Get("force"), (bool)unstashedNotification->Get("reminder"),