aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2025-06-25 14:35:02 +0200
committerMaxence Lange <maxence@artificial-owl.com>2025-06-25 14:35:02 +0200
commit58c089e6f4e6810e8626896c69accf5ab1eaf02c (patch)
tree44d7e2990071c39b34cafea2c3649fac7b26563c
parent3fa81d0dc1cffe88e5e2d8042984e0b6ee77346a (diff)
downloadnextcloud-server-fix/noid/ignore-missing-owner.tar.gz
nextcloud-server-fix/noid/ignore-missing-owner.zip
fix(dav): catch exception on non local accountfix/noid/ignore-missing-owner
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
-rw-r--r--apps/dav/lib/Connector/Sabre/FilesPlugin.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php
index 9e2affddb6b..5364b7cff41 100644
--- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php
@@ -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