aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2022-04-14 20:26:17 +0200
committerGitHub <noreply@github.com>2022-04-14 20:26:17 +0200
commitbccb69f806d536580d33b1992675ed3c6f61dc02 (patch)
treeada2b31f46094730a2037724d439d3a1c03c7cb0 /apps/files_external
parent4ddd41ea82ca03dbd0fdba7688cf830a615222c7 (diff)
parente2aa283dbab472c95c20e2b10b1365f9459b0100 (diff)
downloadnextcloud-server-bccb69f806d536580d33b1992675ed3c6f61dc02.tar.gz
nextcloud-server-bccb69f806d536580d33b1992675ed3c6f61dc02.zip
Merge pull request #30860 from nextcloud/smb-getdirectory-content-catch
handle notfound and notpermitted error in Smb::getDirectoryContent
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/lib/Lib/Storage/SMB.php12
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;
}
}