Permalink
Browse files

Don't assign it if iconv failed.

  • Loading branch information...
1 parent 017e885 commit af49a7e894b7ff91d68bac4d915922948450e8b4 @nurse nurse committed May 31, 2012
@@ -1,8 +1,10 @@
MailHandler.class_eval do
def dispatch_with_ruby_lang_mailing_list_customization
if /iso-2022/i =~ email.charset
- email.body = Iconv.conv("UTF-8", email.charset, email.body) rescue nil
- email.subject = Iconv.conv("UTF-8", email.charset, email.subject) rescue nil
+ str = Iconv.conv("UTF-8", email.charset, email.body) rescue nil
+ email.body = str if str
+ str = Iconv.conv("UTF-8", email.charset, email.subject) rescue nil
+ email.subject = str if str
end
email.subject = email.subject.sub(/\[#{Regexp.escape driver.mailing_list.identifier}:\d+\]/, '')
if subject_tag_re =~ email.subject

0 comments on commit af49a7e

Please sign in to comment.