diff --git a/lib/private/Files/Node/Node.php b/lib/private/Files/Node/Node.php index e00debe690326..f01d2421d1699 100644 --- a/lib/private/Files/Node/Node.php +++ b/lib/private/Files/Node/Node.php @@ -266,7 +266,11 @@ public function isCreatable() { * @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); } /**