Skip to content

Commit 7769165

Browse files
committed
from_address can be nil
and in that case it causes NPE
1 parent 23183c8 commit 7769165

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/models/message.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ def from_mail(mail, list, list_seq)
3838
self.subject = mail.subject
3939
self.subject = Kconv.toutf8 subject if self.subject
4040

41-
self.from = Kconv.toutf8 mail.from_address&.raw
41+
self.from = mail.from_address&.raw
42+
self.from = Kconv.toutf8 from if from
4243
if !self.from && (list.name == 'ruby-core') && (list_seq == 161)
4344
self.from = mail.from.encode Encoding::UTF_8, Encoding::KOI8_R
4445
end

0 commit comments

Comments
 (0)