handle notfound and notpermitted error in Smb::getDirectoryContent

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2022-01-26 17:42:48 +01:00
parent c605ef1f43
commit e2aa283dba
No known key found for this signature in database
GPG key ID: 42B69D8A64526EFB

View file

@ -620,9 +620,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;
}
}