From dee7c56f15c2a1895ec5f9a4366891436ab94392 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 6 Nov 2026 10:52:41 +0100 Subject: [PATCH] fix(federation): Fix federation without trusted servers functionality Signed-off-by: Joas Schilling --- .../AppFramework/Http/Attributes/FederationRateLimit.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/private/AppFramework/Http/Attributes/FederationRateLimit.php b/lib/private/AppFramework/Http/Attributes/FederationRateLimit.php index 98930adceca48..e194e01ef9821 100644 --- a/lib/private/AppFramework/Http/Attributes/FederationRateLimit.php +++ b/lib/private/AppFramework/Http/Attributes/FederationRateLimit.php @@ -10,6 +10,7 @@ namespace OC\AppFramework\Http\Attributes; use Attribute; +use OC\AppFramework\Utility\QueryNotFoundException; use OC\OCM\OCMDiscoveryService; use OCA\Federation\TrustedServers; use OCP\AppFramework\Http\Attribute\AnonRateLimit; @@ -31,7 +32,11 @@ public function __construct(int $limit, int $period) { parent::__construct($limit, $period); $this->discoveryService = Server::get(OCMDiscoveryService::class); - $this->trustedServers = Server::get(TrustedServers::class); + try { + $this->trustedServers = Server::get(TrustedServers::class); + } catch (QueryNotFoundException) { + $this->trustedServers = null; + } } #[\Override]