diff --git a/lib/Operation.php b/lib/Operation.php index b8ab90af..c5ea8c7d 100644 --- a/lib/Operation.php +++ b/lib/Operation.php @@ -18,7 +18,6 @@ use OCP\Files\ForbiddenException; use OCP\Files\IRootFolder; use OCP\Files\Mount\IMountManager; -use OCP\Files\Mount\IMountPoint; use OCP\Files\Node; use OCP\Files\NotFoundException; use OCP\Files\Storage\IStorage; @@ -266,8 +265,16 @@ public function onEvent(string $eventName, Event $event, IRuleMatcher $ruleMatch * @param array|ICacheEntry|null $cacheEntry */ private function getNode(IStorage $storage, string $path, $cacheEntry = null): ?Node { - /** @var IMountPoint|false $mountPoint */ - $mountPoint = current($this->mountManager->findByStorageId($storage->getId())); + $mountPoint = null; + $mounts = $this->mountManager->findByStorageId($storage->getId()); + foreach ($mounts as $mount) { + // we don't want to root mount; + if (strlen($mount->getMountPoint()) > 2) { + $mountPoint = $mount; + break; + } + } + if (!$mountPoint) { return null; }