diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index 8e1287fe..6556a0b2 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -800,6 +800,7 @@ class SFTP extends SSH2 } if (is_array($this->query_stat_cache($this->realpath($dir . '/' . $value)))) { $temp = $this->nlist_helper($dir . '/' . $value, true, $relativeDir . $value . '/'); + $temp = is_array($temp) ? $temp : []; $result = array_merge($result, $temp); } else { $result[] = $relativeDir . $value;