diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php index ca5f13b5f35e3..8c07ec1901bf1 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 OCP\Accounts\IAccountManager; use OCP\Constants; @@ -373,7 +374,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