commit 9d00e7d04d5f425db098fb09564f82f0924f0dc8
parent 704b539ce4aab5c8a8b4218f433a0e4edcb74611
Author: Gaute Hope <eg@gaute.vetsj.com>
Date: Thu, 13 Oct 2011 12:10:27 +0200
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.
Signed-off-by: Hamish Downer
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git 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