Merge pull request #57104 from nextcloud/backport/57096/stable32

[stable32] fix(dav): catch NotFound exception in UploadHome::childExists()
This commit is contained in:
Josh 2025-12-15 16:11:32 -05:00 committed by GitHub
commit 9f1027bed2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14,6 +14,7 @@ use OCP\Files\IRootFolder;
use OCP\Files\NotFoundException;
use OCP\IUserSession;
use Sabre\DAV\Exception\Forbidden;
use Sabre\DAV\Exception\NotFound;
use Sabre\DAV\ICollection;
class UploadHome implements ICollection {
@ -72,7 +73,12 @@ class UploadHome implements ICollection {
}
public function childExists($name): bool {
return !is_null($this->getChild($name));
try {
$this->getChild($name);
return true;
} catch (NotFound $e) {
return false;
}
}
public function delete() {