Subject: [sup-talk] Bug: Opening PGP encrypted mails fails with latest revision

From: [email-masked] (Michael Stapelberg)
Date: Sun, 20 Sep 2009 21:51:38 +0200

Hi,

when opening PGP encrypted mails (MIME), sup crashes with the following
exception:

--- NoMethodError from thread: load messages for thread-view-mode
undefined method `expandable?' for nil:NilClass
/usr/lib/ruby/1.8/sup/modes/thread-view-mode.rb:621:in `regen_text'
/usr/lib/ruby/1.8/sup/modes/thread-view-mode.rb:616:in `each'
/usr/lib/ruby/1.8/sup/modes/thread-view-mode.rb:616:in `regen_text'
/usr/lib/ruby/1.8/sup/thread.rb:68:in `each'
/usr/lib/ruby/1.8/sup/thread.rb:168:in `each_with_stuff'
/usr/lib/ruby/1.8/sup/thread.rb:67:in `each'
/usr/lib/ruby/1.8/sup/modes/thread-view-mode.rb:585:in `regen_text'
/usr/lib/ruby/1.8/sup/modes/thread-view-mode.rb:135:in `initialize'
/usr/lib/ruby/1.8/sup/modes/thread-index-mode.rb:112:in `new'
/usr/lib/ruby/1.8/sup/modes/thread-index-mode.rb:112:in `select'
/usr/lib/ruby/1.8/sup.rb:77:in `reporting_thread'
/usr/lib/ruby/1.8/sup.rb:75:in `initialize'
/usr/lib/ruby/1.8/sup.rb:75:in `new'
/usr/lib/ruby/1.8/sup.rb:75:in `reporting_thread'
/usr/lib/ruby/1.8/sup/modes/thread-index-mode.rb:102:in `select'
/usr/lib/ruby/1.8/sup/mode.rb:50:in `send'
/usr/lib/ruby/1.8/sup/mode.rb:50:in `handle_input'
/usr/lib/ruby/1.8/sup/buffer.rb:265:in `handle_input'
bin/sup:236

Best regards,
Michael

---

From: [email-masked] (Michael Stapelberg)
Date: Fri, 25 Sep 2009 21:08:52 +0200

Hi,

> when opening PGP encrypted mails (MIME), sup crashes with the following
Further debugging revealed that this has been introduced in revision
927b7df4b2052a6b3c2ae1f2b44a6bc901315f8d and can be fixed with the following
patch:

--- a/lib/sup/message.rb
+++ b/lib/sup/message.rb
@@ -413,7 +413,7 @@ private
     notice, sig, decryptedm = CryptoManager.decrypt payload
     if decryptedm # managed to decrypt
       children = message_to_chunks(decryptedm, true)
-      [notice, sig, children]
+      [notice, sig, children].flatten.compact
     else
       [notice]
     end

Best regards,
Michael

---

From: [email-masked] (William Morgan)
Date: Sat, 26 Sep 2009 11:10:04 -0700

Reformatted excerpts from Michael Stapelberg's message of 2009-09-25:
> 927b7df4b2052a6b3c2ae1f2b44a6bc901315f8d and can be fixed with the
> following patch:

Thanks, this should be fixed in git. Give it a try.
-- 
William <wmorgan-sup at masanjin.net>