From 1c4c7cf9e2c1b4baae0453d844e23391cda7dfbb Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 15 Mar 2009 22:33:09 +0000 Subject: [PATCH] don't throw 'Use of uninitialized value in addition (+) at /usr/local/share/perl/5.8.8/FS/cust_svc.pm line 626.' error when using attribute_since_sqlradacct --- FS/FS/cust_svc.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/FS/FS/cust_svc.pm b/FS/FS/cust_svc.pm index 30b23908c..320f78aa0 100644 --- a/FS/FS/cust_svc.pm +++ b/FS/FS/cust_svc.pm @@ -629,7 +629,8 @@ sub attribute_since_sqlradacct { ) or die $dbh->errstr; $sth->execute($username, $start, $end) or die $sth->errstr; - $sum += $sth->fetchrow_arrayref->[0]; + my $row = $sth->fetchrow_arrayref; + $sum += $row->[0] if defined($row->[0]); warn "$mes done SUMing sessions\n" if $DEBUG; -- 2.11.0