summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FS/bin/freeside-torrus-srvderive3
1 files changed, 2 insertions, 1 deletions
diff --git a/FS/bin/freeside-torrus-srvderive b/FS/bin/freeside-torrus-srvderive
index 56535f95d..5ad23aba4 100644
--- a/FS/bin/freeside-torrus-srvderive
+++ b/FS/bin/freeside-torrus-srvderive
@@ -82,7 +82,8 @@ while (1) {
ORDER BY srv_date LIMIT 1";
my $dsth = dbh->prepare($dsql) or die $DBI::errstr;
$dsth->execute or die $dsth->errstr;
- my $date = $dsth->fetchrow_arrayref->[0];
+ my $row = $dsth->fetchrow_arrayref;
+ my $date = (defined($row) && ref($row)) ? $row->[0] : '';
if ( $date ) {
warn "found initial last_srv_date of $date; updating $serviceid\n"
if $DEBUG;