Skip to content

Commit b1d41ab

Browse files
Merge pull request #2354 from nextcloud/backport/2353/stable33
[stable33] fix(federation): Don't break when federation is disabled
2 parents 0e3fe27 + 1b9d603 commit b1d41ab

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/Service/TrustedServerService.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
class TrustedServerService {
1818
public function __construct(
19-
private readonly TrustedServers $trustedServers,
19+
private readonly ?TrustedServers $trustedServers,
2020
private readonly LoggerInterface $logger,
2121
) {
2222
}
@@ -25,6 +25,10 @@ public function __construct(
2525
* @return list<array{id: int, url: string, url_hash: string, shared_secret: ?string, status: int, sync_token: ?string, address: string}>
2626
*/
2727
public function getTrustedServers(): array {
28+
if ($this->trustedServers === null) {
29+
return [];
30+
}
31+
2832
$trustedServers = [];
2933
try {
3034
foreach ($this->trustedServers->getServers() as $server) {

0 commit comments

Comments
 (0)