Guard against nil author or author emails in the Mailer.
This commit is contained in:
parent
ef00061568
commit
84cc8ab215
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue