Merge pull request #30860 from nextcloud/smb-getdirectory-content-catch

handle notfound and notpermitted error in Smb::getDirectoryContent
This commit is contained in:
Vincent Petry 2022-04-14 20:26:17 +02:00 committed by GitHub
commit bccb69f806
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}
}