projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix "Can' tuse an undefined value as an ARRAY reference" error for new virtual ports...
[freeside.git]
/
FS
/
bin
/
freeside-torrus-srvderive
diff --git
a/FS/bin/freeside-torrus-srvderive
b/FS/bin/freeside-torrus-srvderive
index
56535f9
..
5ad23ab
100644
(file)
--- 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;
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;
if ( $date ) {
warn "found initial last_srv_date of $date; updating $serviceid\n"
if $DEBUG;