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

Re: [sup-devel] [PATCH] Don't fail on empty lines while expanding



Applied to next.

Hamish

On 13 October 2011 11:10, Gaute Hope <eg@gaute.vetsj.com> wrote:
> 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
>
> _______________________________________________
> Sup-devel mailing list
> Sup-devel@rubyforge.org
> http://rubyforge.org/mailman/listinfo/sup-devel
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel