Merge pull request #35398 from nextcloud/artonge/fix/dont_error_when_destination_is_not_a_node

Do not check quota for non Node
This commit is contained in:
Louis 2022-11-24 16:10:11 +01:00 committed by GitHub
commit 6502e3c5be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -148,14 +148,14 @@ class QuotaPlugin extends \Sabre\DAV\ServerPlugin {
public function beforeCopy(string $sourcePath, string $destinationPath): bool {
$sourceNode = $this->server->tree->getNodeForPath($sourcePath);
if (!$sourceNode instanceof Node) {
return false;
return true;
}
// get target node for proper path conversion
if ($this->server->tree->nodeExists($destinationPath)) {
$destinationNode = $this->server->tree->getNodeForPath($destinationPath);
if (!$destinationNode instanceof Node) {
return false;
return true;
}
$path = $destinationNode->getPath();
} else {
@ -165,7 +165,7 @@ class QuotaPlugin extends \Sabre\DAV\ServerPlugin {
}
$parentNode = $this->server->tree->getNodeForPath($parent);
if (!$parentNode instanceof Node) {
return false;
return true;
}
$path = $parentNode->getPath();
}