fix(dav): catch exception on non local account

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
This commit is contained in:
Maxence Lange 2025-06-25 14:35:02 +02:00
parent 3fa81d0dc1
commit 58c089e6f4

View file

@ -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 OCA\Files_Sharing\External\Mount as SharingExternalMount;
use OCP\Accounts\IAccountManager;
@ -374,7 +375,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