diff options
author | Robin Appelman <robin@icewind.nl> | 2022-01-26 17:42:48 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2022-02-11 17:23:54 +0100 |
commit | e2aa283dbab472c95c20e2b10b1365f9459b0100 (patch) | |
tree | a2b1617f2d863e647437fce3c8a530c19d8e3932 /apps/files_external/lib | |
parent | c605ef1f432dcd48ba4b3b8cc82551c234dc4f64 (diff) | |
download | nextcloud-server-e2aa283dbab472c95c20e2b10b1365f9459b0100.tar.gz nextcloud-server-e2aa283dbab472c95c20e2b10b1365f9459b0100.zip |
handle notfound and notpermitted error in Smb::getDirectoryContent
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_external/lib')
-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 28a2d6de7cc..81ee39d20e2 100644 --- a/apps/files_external/lib/Lib/Storage/SMB.php +++ b/apps/files_external/lib/Lib/Storage/SMB.php @@ -620,9 +620,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; } } |