Subject: [PATCH] Don't fail on empty lines while expanding

From: Gaute Hope <[email-masked]>
Date: Thu, 13 Oct 2011 12:10:27 +0200

While expanding an GPG signature which must have contained a line that
ended up as nil while chomp'ing, chomp will crash. This patch filters
out lines which are nil.
---
 lib/sup/modes/thread-view-mode.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/sup/modes/thread-view-mode.rb b/lib/sup/modes/thread-view-mode.rb
index 9fcc45d..ec1a82e 100644
--- a/lib/sup/modes/thread-view-mode.rb
+++ b/lib/sup/modes/thread-view-mode.rb
@@ -846,7 +846,7 @@ private
       else
         width = buffer.content_width
       end
-      lines = lines.map { |l| l.chomp.wrap width }.flatten
+      lines = lines.map { |l| l.chomp.wrap width if l }.flatten
     end
     return lines
   end
-- 
1.7.7

---

From: Hamish D <[email-masked]>
Date: Sat, 17 Dec 2011 18:46:07 +0000

Applied to next.

Hamish

On 13 October 2011 11:10, Gaute Hope <[email-masked]> wrote:
> _______________________________________________
> Sup-devel mailing list
> [email-masked]
> http://rubyforge.org/mailman/listinfo/sup-devel
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel