diff --git a/lib/private/Files/Node/Node.php b/lib/private/Files/Node/Node.php index 304b2ccf46..d2232624b9 100644 --- a/lib/private/Files/Node/Node.php +++ b/lib/private/Files/Node/Node.php @@ -265,7 +265,11 @@ class Node implements \OCP\Files\Node { * @return Node */ public function getParent() { - return $this->root->get(dirname($this->path)); + $newPath = dirname($this->path); + if ($newPath === '' || $newPath === '.' || $newPath === '/') { + return $this->root; + } + return $this->root->get($newPath); } /**