Skip to content

Commit 58c089e

Browse files
committed
fix(dav): catch exception on non local account
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
1 parent 3fa81d0 commit 58c089e

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 OCA\Files_Sharing\External\Mount as SharingExternalMount;
1415
use OCP\Accounts\IAccountManager;
@@ -374,7 +375,13 @@ public function handleGetProperties(PropFind $propFind, \Sabre\DAV\INode $node)
374375
}
375376

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

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

0 commit comments

Comments
 (0)