From mboxrd@z Thu Jan 1 00:00:00 1970 From: marka@pobox.com (Mark Alexander) Date: Tue, 02 Jun 2009 09:29:13 -0700 Subject: [sup-talk] [PATCH] Handle nil charset on attachments. Message-ID: <1243959935-sup-8233@r50p> I updated to the latest 'next' branch of sup this morning, and immediately ran into a crash when viewing a message with an attachement, which was probably sent by an Outlook user. The crash was due to a nil charset; this patch fixes the crash. --- lib/sup/message-chunks.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/sup/message-chunks.rb b/lib/sup/message-chunks.rb index 3f57346..41d924b 100644 --- a/lib/sup/message-chunks.rb +++ b/lib/sup/message-chunks.rb @@ -98,7 +98,7 @@ EOS text = case @content_type when /^text\/plain\b/ - Iconv.easy_decode $encoding, encoded_content.charset, @raw_content + Iconv.easy_decode $encoding, encoded_content.charset || $encoding, @raw_content else HookManager.run "mime-decode", :content_type => content_type, :filename => lambda { write_to_disk },