fix(dav): catch NotFound exception in UploadHome::childExists()

Signed-off-by: Josh <josh.t.richards@gmail.com>
pull/57096/head
Josh 2025-12-15 10:57:47 +07:00 committed by GitHub
parent b15e294a6e
commit c6dd592d60
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 1 deletions

@ -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() {