Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] [PATCH] Handle nil charset on attachments.
@ 2009-06-02 16:29 Mark Alexander
  2009-06-02 16:46 ` William Morgan
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Alexander @ 2009-06-02 16:29 UTC (permalink / 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 },


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-06-02 16:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-02 16:29 [sup-talk] [PATCH] Handle nil charset on attachments Mark Alexander
2009-06-02 16:46 ` William Morgan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox