summaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Node/Node.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Files/Node/Node.php')
-rw-r--r--lib/private/Files/Node/Node.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/Files/Node/Node.php b/lib/private/Files/Node/Node.php
index e00debe6903..f01d2421d16 100644
--- a/lib/private/Files/Node/Node.php
+++ b/lib/private/Files/Node/Node.php
@@ -266,7 +266,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);
}
/**