From 0d6c9d3b1c0d63fb22588e0e461912a7e00bec25 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Thu, 30 Aug 2012 14:47:15 -0700 Subject: In show, handle undefined columns Some database drivers, such as current SQLite, will return undef for a data column that is set to NULL instead of the empty string. Skip past those data columns without attempting to examine the length of the resulting data. --- perl/Wallet/Object/Base.pm | 1 + 1 file changed, 1 insertion(+) (limited to 'perl/Wallet') diff --git a/perl/Wallet/Object/Base.pm b/perl/Wallet/Object/Base.pm index 28ec6b9..556cb27 100644 --- a/perl/Wallet/Object/Base.pm +++ b/perl/Wallet/Object/Base.pm @@ -610,6 +610,7 @@ sub show { # trace field since they're not a field in the object in their own right. # The comment should be word-wrapped at 80 columns. for my $i (0 .. $#data) { + next unless defined $data[$i]; if ($attrs[$i][0] eq 'ob_comment' && length ($data[$i]) > 79 - 17) { local $Text::Wrap::columns = 80; local $Text::Wrap::unexpand = 0; -- cgit v1.2.3