summaryrefslogtreecommitdiff
path: root/perl/Wallet
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2012-08-30 14:47:15 -0700
committerRuss Allbery <rra@stanford.edu>2012-08-30 14:47:15 -0700
commit0d6c9d3b1c0d63fb22588e0e461912a7e00bec25 (patch)
tree40a557228f30d7f199d209104fc14608bc12e237 /perl/Wallet
parente5345b50c36e3b07b9e8ec5202ed0f60bc8e2010 (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.
Diffstat (limited to 'perl/Wallet')
-rw-r--r--perl/Wallet/Object/Base.pm1
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;