diff --git a/lib/private/Files/Node/Folder.php b/lib/private/Files/Node/Folder.php index 73e7377c26bfd..69762f6ecabed 100644 --- a/lib/private/Files/Node/Folder.php +++ b/lib/private/Files/Node/Folder.php @@ -314,7 +314,7 @@ public function getById($id) { } public function getFirstNodeById(int $id): ?\OCP\Files\Node { - return current($this->getById($id)) ?: null; + return $this->root->getFirstNodeByIdInPath($id, $this->getPath()); } protected function getAppDataDirectoryName(): string {