From 84cc8ab215649f5e576ba7cea76d46d19e7e299e Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Mon, 12 Jul 2010 09:35:31 -0700 Subject: [PATCH] Guard against nil author or author emails in the Mailer. --- app/models/mailer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/mailer.rb b/app/models/mailer.rb index c4bba852..b99e211d 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -387,7 +387,7 @@ class Mailer < ActionMailer::Base # Removes the current user from the recipients and cc # if he doesn't want to receive notifications about what he does @author ||= User.current - if @author.pref[:no_self_notified] + if @author && @author.mail && @author.pref[:no_self_notified] recipients((recipients.is_a?(Array) ? recipients : [recipients]) - [@author.mail]) if recipients.present? cc((cc.is_a?(Array) ? cc : [cc]) - [@author.mail]) if cc.present? end