From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (c6A855BC1.dhcp.bluecom.no. [193.91.133.106]) by mx.google.com with ESMTPS id e14sm3036536bka.0.2011.10.13.03.14.16 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 13 Oct 2011 03:14:17 -0700 (PDT) Content-Type: text/plain; charset=UTF-8 From: Gaute Hope To: sup-devel Subject: [PATCH] Don't fail on empty lines while expanding Date: Thu, 13 Oct 2011 12:10:27 +0200 Message-Id: <1318500554-sup-8811@qwerzila> User-Agent: Sup/git Content-Transfer-Encoding: 8bit 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