aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Node/Folder.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Files/Node/Folder.php')
-rw-r--r--lib/private/Files/Node/Folder.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/private/Files/Node/Folder.php b/lib/private/Files/Node/Folder.php
index 44f47e92ca0..9714a0aea00 100644
--- a/lib/private/Files/Node/Folder.php
+++ b/lib/private/Files/Node/Folder.php
@@ -330,8 +330,13 @@ class Folder extends Node implements \OCP\Files\Folder {
* @return array
*/
protected function getByIdInRootMount(int $id): array {
- $mount = $this->root->getMount('');
- $cacheEntry = $mount->getStorage()->getCache($this->path)->get($id);
+ $storage = null;
+ if (\method_exists($this->root, 'getMount')) {
+ /** @var IMountPoint $mount */
+ $mount = $this->root->getMount('');
+ $storage = $mount->getStorage();
+ }
+ $cacheEntry = $storage?->getCache($this->path)->get($id);
if (!$cacheEntry) {
return [];
}
@@ -346,7 +351,7 @@ class Folder extends Node implements \OCP\Files\Folder {
return [$this->root->createNode(
$absolutePath, new \OC\Files\FileInfo(
$absolutePath,
- $mount->getStorage(),
+ $storage,
$cacheEntry->getPath(),
$cacheEntry,
$mount