Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: marka@pobox.com (Mark Alexander)
Subject: [sup-talk] [PATCH] Handle nil charset on attachments.
Date: Tue, 02 Jun 2009 09:29:13 -0700	[thread overview]
Message-ID: <1243959935-sup-8233@r50p> (raw)

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 },


             reply	other threads:[~2009-06-02 16:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-02 16:29 Mark Alexander [this message]
2009-06-02 16:46 ` William Morgan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1243959935-sup-8233@r50p \
    --to=marka@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox