Archive of RubyForge sup-devel mailing list
 help / color / mirror / Atom feed
* [PATCH] Don't fail on empty lines while expanding
@ 2011-10-13 10:10 Gaute Hope
  2011-12-17 18:46 ` [sup-devel] " Hamish D
  0 siblings, 1 reply; 2+ messages in thread
From: Gaute Hope @ 2011-10-13 10:10 UTC (permalink / raw)
  To: sup-devel

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



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

end of thread, other threads:[~2011-12-17 19:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-13 10:10 [PATCH] Don't fail on empty lines while expanding Gaute Hope
2011-12-17 18:46 ` [sup-devel] " Hamish D

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