Guard against nil author or author emails in the Mailer.

This commit is contained in:
Eric Davis 2010-07-12 09:35:31 -07:00
parent ef00061568
commit 84cc8ab215
1 changed files with 1 additions and 1 deletions

View File

@ -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