From c23da8a1b6f7e636c26aef4f8858cdecb5b73431 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 15 Feb 2022 15:08:37 +0100 Subject: [PATCH] fix handling of non existing files in SFTP::filetype Signed-off-by: Robin Appelman --- apps/files_external/lib/Lib/Storage/SFTP.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/files_external/lib/Lib/Storage/SFTP.php b/apps/files_external/lib/Lib/Storage/SFTP.php index ae049007cdc67..b4d1e1ca8b3e6 100644 --- a/apps/files_external/lib/Lib/Storage/SFTP.php +++ b/apps/files_external/lib/Lib/Storage/SFTP.php @@ -327,6 +327,9 @@ public function opendir($path) { public function filetype($path) { try { $stat = $this->getConnection()->stat($this->absPath($path)); + if ($stat === false) { + return false; + } if ((int) $stat['type'] === NET_SFTP_TYPE_REGULAR) { return 'file'; }