Skip to content

Commit 9f1027b

Browse files
Merge pull request #57104 from nextcloud/backport/57096/stable32
[stable32] fix(dav): catch NotFound exception in UploadHome::childExists()
2 parents fb249c2 + 8f2291d commit 9f1027b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

apps/dav/lib/Upload/UploadHome.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use OCP\Files\NotFoundException;
1515
use OCP\IUserSession;
1616
use Sabre\DAV\Exception\Forbidden;
17+
use Sabre\DAV\Exception\NotFound;
1718
use Sabre\DAV\ICollection;
1819

1920
class UploadHome implements ICollection {
@@ -72,7 +73,12 @@ public function getChildren(): array {
7273
}
7374

7475
public function childExists($name): bool {
75-
return !is_null($this->getChild($name));
76+
try {
77+
$this->getChild($name);
78+
return true;
79+
} catch (NotFound $e) {
80+
return false;
81+
}
7682
}
7783

7884
public function delete() {

0 commit comments

Comments
 (0)