don't throw 'Use of uninitialized value in addition (+) at /usr/local/share/perl...
authorivan <ivan>
Sun, 15 Mar 2009 22:33:10 +0000 (22:33 +0000)
committerivan <ivan>
Sun, 15 Mar 2009 22:33:10 +0000 (22:33 +0000)
FS/FS/cust_svc.pm

index b56dde7..42681a0 100644 (file)
@@ -623,7 +623,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;