Suppress error message about undefined value
authorJason Stephenson <jason@sigio.com>
Tue, 9 Jul 2019 19:13:21 +0000 (15:13 -0400)
committerJason Stephenson <jason@sigio.com>
Tue, 9 Jul 2019 19:13:21 +0000 (15:13 -0400)
Squelch "Can't call method "message" on an undefined value at
/usr/local/share/perl/5.22.1/OpenILS/Utils/RemoteAccount.pm line 650."
on Ubuntu Xenial.  I think this points to a larger bug and we're just
plastering over it.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Open-ILS/src/perlmods/lib/OpenILS/Utils/RemoteAccount.pm

index d849a8c..b40f0dd 100644 (file)
@@ -649,7 +649,8 @@ sub ls_ftp {   # returns full path like: dir/path/file.ext
         if ($@ or !@part) {
             $logger->error(
                 $self->_error(
-                    "ls from",  $self->remote_host, "failed with error: " . $self->_ftp->message
+                    "ls from",  $self->remote_host, "failed with error: " . (defined($self->_ftp))
+                        ? $self->_ftp->message : $@
                 )
             );
             next;