Skip to content

Commit 231ec2a

Browse files
committed
handle notfound and notpermitted error in Smb::getDirectoryContent
Signed-off-by: Robin Appelman <[email protected]>
1 parent c605ef1 commit 231ec2a

File tree

1 file changed

+7
-1
lines changed
  • apps/files_external/lib/Lib/Storage

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,13 @@ public function opendir($path) {
620620
}
621621

622622
public function getDirectoryContent($directory): \Traversable {
623-
$files = $this->getFolderContents($directory);
623+
try {
624+
$files = $this->getFolderContents($directory);
625+
} catch (NotFoundException $e) {
626+
return;
627+
} catch (NotPermittedException $e) {
628+
return;
629+
}
624630
foreach ($files as $file) {
625631
yield $this->getMetaDataFromFileInfo($file);
626632
}

0 commit comments

Comments
 (0)