summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2010-08-04 18:50:08 +0000
committerivan <ivan>2010-08-04 18:50:08 +0000
commit543cb4d548e42826e377c4790e28bb730d7ddf66 (patch)
treef8b0f2fea20a123499df3e6fb7e7758f3a305ddd
parent2a3f01ee52079e883b04b3f603dbdf9f339a034b (diff)
fix scalar_sql not to return empty string for zero
-rw-r--r--FS/FS/Record.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm
index cd5e2d4ca..44bc28d46 100644
--- a/FS/FS/Record.pm
+++ b/FS/FS/Record.pm
@@ -2817,7 +2817,8 @@ sub scalar_sql {
my $sth = dbh->prepare($sql) or die dbh->errstr;
$sth->execute
or die "Unexpected error executing statement $sql: ". $sth->errstr;
- $sth->fetchrow_arrayref->[0] || '';
+ my $scalar = $sth->fetchrow_arrayref->[0];
+ defined($scalar) ? $scalar : '';
}
=back