Skip to content

Commit bccb69f

Browse files
authored
Merge pull request #30860 from nextcloud/smb-getdirectory-content-catch
handle notfound and notpermitted error in Smb::getDirectoryContent
2 parents 4ddd41e + e2aa283 commit bccb69f

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

  • apps/files_external/lib/Lib/Storage

apps/files_external/lib/Lib/Storage/SMB.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -628,9 +628,15 @@ public function opendir($path) {
628628
}
629629

630630
public function getDirectoryContent($directory): \Traversable {
631-
$files = $this->getFolderContents($directory);
632-
foreach ($files as $file) {
633-
yield $this->getMetaDataFromFileInfo($file);
631+
try {
632+
$files = $this->getFolderContents($directory);
633+
foreach ($files as $file) {
634+
yield $this->getMetaDataFromFileInfo($file);
635+
}
636+
} catch (NotFoundException $e) {
637+
return;
638+
} catch (NotPermittedException $e) {
639+
return;
634640
}
635641
}
636642

0 commit comments

Comments
 (0)