diff options
-rw-r--r-- | apps/files_external/lib/Lib/Storage/SMB.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/apps/files_external/lib/Lib/Storage/SMB.php b/apps/files_external/lib/Lib/Storage/SMB.php index 6464264f3a4..c2555f87b93 100644 --- a/apps/files_external/lib/Lib/Storage/SMB.php +++ b/apps/files_external/lib/Lib/Storage/SMB.php @@ -628,9 +628,15 @@ class SMB extends Common implements INotifyStorage { } public function getDirectoryContent($directory): \Traversable { - $files = $this->getFolderContents($directory); - foreach ($files as $file) { - yield $this->getMetaDataFromFileInfo($file); + try { + $files = $this->getFolderContents($directory); + foreach ($files as $file) { + yield $this->getMetaDataFromFileInfo($file); + } + } catch (NotFoundException $e) { + return; + } catch (NotPermittedException $e) { + return; } } |