[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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