Skip to content

Commit a52d28c

Browse files
Merge pull request #53681 from nextcloud/backport/53677/stable31
[stable31] fix(dav): catch exception on non local account
2 parents 5084f68 + 0f7cbf4 commit a52d28c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

apps/dav/lib/Connector/Sabre/FilesPlugin.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
use OC\AppFramework\Http\Request;
1111
use OC\FilesMetadata\Model\FilesMetadata;
12+
use OC\User\NoUserException;
1213
use OCA\DAV\Connector\Sabre\Exception\InvalidPath;
1314
use OCP\Accounts\IAccountManager;
1415
use OCP\Constants;
@@ -373,7 +374,13 @@ public function handleGetProperties(PropFind $propFind, \Sabre\DAV\INode $node)
373374
}
374375

375376
// Check if the user published their display name
376-
$ownerAccount = $this->accountManager->getAccount($owner);
377+
try {
378+
$ownerAccount = $this->accountManager->getAccount($owner);
379+
} catch (NoUserException) {
380+
// do not lock process if owner is not local
381+
return null;
382+
}
383+
377384
$ownerNameProperty = $ownerAccount->getProperty(IAccountManager::PROPERTY_DISPLAYNAME);
378385

379386
// Since we are not logged in, we need to have at least the published scope

0 commit comments

Comments
 (0)