From 3576923edf788eecb4320e034f5afaaf625bd62e Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Wed, 15 Jun 2011 19:47:00 +0100 Subject: Missed from last commit --- lib/mauve/alert_changed.rb | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/lib/mauve/alert_changed.rb b/lib/mauve/alert_changed.rb index 4668fd7..68a0a00 100644 --- a/lib/mauve/alert_changed.rb +++ b/lib/mauve/alert_changed.rb @@ -52,10 +52,6 @@ module Mauve Log4r::Logger.new self.class.to_s end -## def initialize -# logger = Log4r::Logger.new self.class.to_s -# end - ## Checks to see if a raise was send to the person. # # @TODO: Recurence is broken in ruby, change this so that it does not @@ -100,14 +96,20 @@ module Mauve save else saved = false - - alert_group.notifications.each do |notification| - notification.people.each do |person| - if person.username == self.person - person.remind(alert, level) - self.remind_at = notification.remind_at_next(alert) - save - saved = true + + unless alert_group.notifications.nil? + + alert_group.notifications.each do |notification| + notification.people.each do |person| + # Not interested in nil people. + next if person.nil? + + if person.username == self.person + person.remind(alert, level) + self.remind_at = notification.remind_at_next(alert) + save + saved = true + end end end end -- cgit v1.2.1