Skip to content

Commit

Permalink
fix: Pass parent to NonExistingFile instances
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliushaertl committed Sep 6, 2023
1 parent 7ee34a3 commit 581c2be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/private/Files/Node/File.php
Expand Up @@ -40,7 +40,7 @@ class File extends Node implements \OCP\Files\File {
* @return NonExistingFile non-existing node
*/
protected function createNonExistingNode($path) {
return new NonExistingFile($this->root, $this->view, $path);
return new NonExistingFile($this->root, $this->view, $path, $this->root->get(dirname($path)));
}

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/private/Files/Node/HookConnector.php
Expand Up @@ -224,9 +224,9 @@ private function getNodeForPath(string $path): Node {
$info = null;
}
if (Filesystem::is_dir($path)) {
return new NonExistingFolder($this->root, $this->view, $fullPath, $info);
return new NonExistingFolder($this->root, $this->view, $fullPath, $info, $this->root->get(dirname($fullPath)));
} else {
return new NonExistingFile($this->root, $this->view, $fullPath, $info);
return new NonExistingFile($this->root, $this->view, $fullPath, $info, $this->root->get(dirname($fullPath)));
}
}
if ($info->getType() === FileInfo::TYPE_FILE) {
Expand Down

0 comments on commit 581c2be

Please sign in to comment.