projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2a3f01e
)
fix scalar_sql not to return empty string for zero
author
ivan
<ivan>
Wed, 4 Aug 2010 18:50:08 +0000
(18:50 +0000)
committer
ivan
<ivan>
Wed, 4 Aug 2010 18:50:08 +0000
(18:50 +0000)
FS/FS/Record.pm
patch
|
blob
|
history
diff --git
a/FS/FS/Record.pm
b/FS/FS/Record.pm
index
cd5e2d4
..
44bc28d
100644
(file)
--- 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