mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Merge pull request #30860 from nextcloud/smb-getdirectory-content-catch
handle notfound and notpermitted error in Smb::getDirectoryContent
This commit is contained in:
commit
bccb69f806
1 changed files with 9 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue