manager: Guard agg.Rule against dereferencing when nil.

Fixes: #122
This commit is contained in:
Florian Forster 2015-11-20 09:52:55 +01:00
parent 86f5f8032a
commit 72ccbb28cb

View File

@ -279,7 +279,9 @@ func (s *memoryAlertManager) removeExpiredAggregates() {
if time.Since(agg.LastRefreshed) > s.minRefreshInterval {
delete(s.aggregates, agg.Alert.Fingerprint())
s.notifier.QueueNotification(agg.Alert, notificationOpResolve, agg.Rule.NotificationConfigName)
if agg.Rule != nil {
s.notifier.QueueNotification(agg.Alert, notificationOpResolve, agg.Rule.NotificationConfigName)
}
s.needsNotificationRefresh = true
} else {
heap.Push(&s.aggregatesByLastRefreshed, agg)