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

index 30b2390..320f78a 100644 (file)
@@ -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;