From: ivan Date: Wed, 4 Aug 2010 18:50:08 +0000 (+0000) Subject: fix scalar_sql not to return empty string for zero X-Git-Tag: TORRUS_1_0_9~434 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=543cb4d548e42826e377c4790e28bb730d7ddf66 fix scalar_sql not to return empty string for zero --- 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