diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2025-06-25 14:35:02 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2025-06-25 13:36:24 +0000 |
commit | 0f7cbf4e293d7657586fe6866e902490e7c4a0ce (patch) | |
tree | e3fa76f9928fcb6f92067fdd4bb852a9f8d0b428 | |
parent | e9ce122b85cde2d788613934321297336fb51e3c (diff) | |
download | nextcloud-server-backport/53677/stable31.tar.gz nextcloud-server-backport/53677/stable31.zip |
fix(dav): catch exception on non local accountbackport/53677/stable31
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
-rw-r--r-- | apps/dav/lib/Connector/Sabre/FilesPlugin.php | 9 |
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 ca5f13b5f35..8c07ec1901b 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 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 |