aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2012-12-05 15:11:59 +0000
committerLouise Crow <louise.crow@gmail.com>2012-12-05 15:15:34 +0000
commitdbf58d12293cb7efb699900193a434b6e3892f36 (patch)
tree80f7fd34e636216f2929a9c6d0da174be3419d53
parent7516b1abd0b5e871e93590b58bfe10520108382f (diff)
Now that the underlying methods handle the case where there is no from field content by returning nil, I don't think we need to rescue a NoMethodError - this would have originally been returned by calling spec on from_addrs[0] when it was nil.
-rw-r--r--app/models/incoming_message.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 1cc81a782..feef8fb71 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -125,9 +125,9 @@ class IncomingMessage < ActiveRecord::Base
self.sent_at = self.mail.date || self.created_at
self.subject = self.mail.subject
self.mail_from = MailHandler.get_from_name(self.mail)
- begin
+ if self.from_email
self.mail_from_domain = PublicBody.extract_domain_from_email(self.from_email)
- rescue NoMethodError
+ else
self.mail_from_domain = ""
end
self.valid_to_reply_to = self._calculate_valid_to_reply_to