From 58c089e6f4e6810e8626896c69accf5ab1eaf02c Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Wed, 25 Jun 2025 14:35:02 +0200 Subject: [PATCH] fix(dav): catch exception on non local account Signed-off-by: Maxence Lange --- apps/dav/lib/Connector/Sabre/FilesPlugin.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php index 9e2affddb6b05..5364b7cff41b8 100644 --- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php @@ -9,6 +9,7 @@ use OC\AppFramework\Http\Request; use OC\FilesMetadata\Model\FilesMetadata; +use OC\User\NoUserException; use OCA\DAV\Connector\Sabre\Exception\InvalidPath; use OCA\Files_Sharing\External\Mount as SharingExternalMount; use OCP\Accounts\IAccountManager; @@ -374,7 +375,13 @@ public function handleGetProperties(PropFind $propFind, \Sabre\DAV\INode $node) } // Check if the user published their display name - $ownerAccount = $this->accountManager->getAccount($owner); + try { + $ownerAccount = $this->accountManager->getAccount($owner); + } catch (NoUserException) { + // do not lock process if owner is not local + return null; + } + $ownerNameProperty = $ownerAccount->getProperty(IAccountManager::PROPERTY_DISPLAYNAME); // Since we are not logged in, we need to have at least the published scope