diff --git a/synapse/federation/federation_server.py b/synapse/federation/federation_server.py index 1d25b7c479..5d4dc6370c 100644 --- a/synapse/federation/federation_server.py +++ b/synapse/federation/federation_server.py @@ -672,7 +672,10 @@ class FederationServer(FederationBase): span=span, ) - defer.returnValue({"did_not_relay": list(dont_relay)}) + ret = {} + if dont_relay: + ret = {"did_not_relay": list(dont_relay)} + defer.returnValue(ret) def __str__(self): return "" % self.server_name