diff options
author | Russ Allbery <rra@stanford.edu> | 2012-08-30 14:47:15 -0700 |
---|---|---|
committer | Russ Allbery <rra@stanford.edu> | 2012-08-30 14:47:15 -0700 |
commit | 0d6c9d3b1c0d63fb22588e0e461912a7e00bec25 (patch) | |
tree | 40a557228f30d7f199d209104fc14608bc12e237 | |
parent | e5345b50c36e3b07b9e8ec5202ed0f60bc8e2010 (diff) |
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.
-rw-r--r-- | perl/Wallet/Object/Base.pm | 1 |
1 files changed, 1 insertions, 0 deletions
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; |