Skip to content

Commit

Permalink
handle notfound and notpermitted error in Smb::getDirectoryContent
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 committed Feb 11, 2022
1 parent c605ef1 commit 231ec2a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion apps/files_external/lib/Lib/Storage/SMB.php
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,13 @@ public function opendir($path) {
}

public function getDirectoryContent($directory): \Traversable {
$files = $this->getFolderContents($directory);
try {
$files = $this->getFolderContents($directory);
} catch (NotFoundException $e) {
return;
} catch (NotPermittedException $e) {
return;
}
foreach ($files as $file) {
yield $this->getMetaDataFromFileInfo($file);
}
Expand Down

0 comments on commit 231ec2a

Please sign in to comment.