Skip to content

Commit 1b9d603

Browse files
nickvergessenbackportbot[bot]
authored andcommitted
fix(federation): Don't break when federation is disabled
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent 0e3fe27 commit 1b9d603

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)