diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index 1729ef83..0c568e53 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -750,7 +750,7 @@ class SFTP extends SSH2 { $files = $this->_list($dir, false); - if (!$recursive) { + if (!$recursive || $files === false) { return $files; }