Merge pull request #53681 from nextcloud/backport/53677/stable31

[stable31] fix(dav): catch exception on non local account
pull/53686/head
Andy Scherzinger 2025-06-25 17:19:07 +07:00 committed by GitHub
commit a52d28c66c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 1 deletions

@ -9,6 +9,7 @@ namespace OCA\DAV\Connector\Sabre;
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 @@ class FilesPlugin extends ServerPlugin {
}
// 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