Skip to content

Commit

Permalink
fix: Avoid throwing exceptions during propfind
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliusknorr authored and backportbot[bot] committed Jul 31, 2024
1 parent e007f41 commit 8ded243
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/DAV/WorkspacePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@
use OCA\DAV\Files\FilesHome;
use OCA\Text\AppInfo\Application;
use OCA\Text\Service\WorkspaceService;
use OCP\Files\GenericFileException;
use OCP\Files\IRootFolder;
use OCP\Files\NotPermittedException;
use OCP\Files\StorageNotAvailableException;
use OCP\IConfig;
use OCP\Lock\LockedException;
use Sabre\DAV\INode;
use Sabre\DAV\PropFind;
use Sabre\DAV\Server;
Expand Down Expand Up @@ -115,9 +118,12 @@ public function propFind(PropFind $propFind, INode $node) {

// Only return the property for the parent node and ignore it for further in depth nodes
$propFind->handle(self::WORKSPACE_PROPERTY, function () use ($file) {
if ($file instanceof File) {
return $file->getContent();
}
try {
if ($file instanceof File) {
return $file->getContent();
}
} catch (GenericFileException|NotPermittedException|LockedException) {}

return '';
});
$propFind->handle(self::WORKSPACE_FILE_PROPERTY, function () use ($file) {
Expand Down

0 comments on commit 8ded243

Please sign in to comment.