summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/lib/Lib/Storage/SMB.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/apps/files_external/lib/Lib/Storage/SMB.php b/apps/files_external/lib/Lib/Storage/SMB.php
index d8bbe8c4718..c9828606ffb 100644
--- a/apps/files_external/lib/Lib/Storage/SMB.php
+++ b/apps/files_external/lib/Lib/Storage/SMB.php
@@ -156,7 +156,13 @@ class SMB extends Common implements INotifyStorage {
$this->statCache[$path . '/' . $file->getName()] = $file;
}
return array_filter($files, function (IFileInfo $file) {
- return !$file->isHidden();
+ try {
+ return !$file->isHidden();
+ } catch (ForbiddenException $e) {
+ return false;
+ } catch (NotFoundException $e) {
+ return false;
+ }
});
} catch (ConnectException $e) {
throw new StorageNotAvailableException($e->getMessage(), $e->getCode(), $e);
@@ -230,8 +236,12 @@ class SMB extends Common implements INotifyStorage {
$highestMTime = 0;
$files = $this->share->dir($this->root);
foreach ($files as $fileInfo) {
- if ($fileInfo->getMTime() > $highestMTime) {
- $highestMTime = $fileInfo->getMTime();
+ try {
+ if ($fileInfo->getMTime() > $highestMTime) {
+ $highestMTime = $fileInfo->getMTime();
+ }
+ } catch (NotFoundException $e) {
+ // Ignore this, can happen on unavailable DFS shares
}
}
return $highestMTime;