Skip to content

Commit 5559a51

Browse files
authored
Fix ftp_nlist for empty folders return false
1 parent 4930963 commit 5559a51

File tree

1 file changed

+2
-1
lines changed
  • lib/internal/Magento/Framework/Filesystem/Io

1 file changed

+2
-1
lines changed

lib/internal/Magento/Framework/Filesystem/Io/Ftp.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,10 @@ public function chmod($filename, $mode)
313313
*/
314314
public function ls($grep = null)
315315
{
316-
$ls = @ftp_nlist($this->_conn, '.');
316+
$ls = @ftp_nlist($this->_conn, '.') ?? [];
317317

318318
$list = [];
319+
319320
foreach ($ls as $file) {
320321
$list[] = ['text' => $file, 'id' => $this->pwd() . '/' . $file];
321322
}

0 commit comments

Comments
 (0)