Merge pull request #12059 from mikaelh/stable12
Actually return the root folder when traversing up the tree
This commit is contained in:
commit
797d28cc4d
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue