Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit c570f24

Browse files
committed
Don't assume that an event has an origin field
This fixes #8319.
1 parent eadfda3 commit c570f24

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

synapse/federation/federation_client.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
from synapse.federation.federation_base import FederationBase, event_from_pdu_json
5555
from synapse.logging.context import make_deferred_yieldable, preserve_fn
5656
from synapse.logging.utils import log_function
57-
from synapse.types import JsonDict
57+
from synapse.types import JsonDict, get_domain_from_id
5858
from synapse.util import unwrapFirstError
5959
from synapse.util.caches.expiringcache import ExpiringCache
6060
from synapse.util.retryutils import NotRetryingDestination
@@ -386,10 +386,11 @@ async def handle_check_result(pdu: EventBase, deferred: Deferred):
386386
pdu.event_id, allow_rejected=True, allow_none=True
387387
)
388388

389-
if not res and pdu.origin != origin:
389+
pdu_origin = get_domain_from_id(pdu.sender)
390+
if not res and pdu_origin != origin:
390391
try:
391392
res = await self.get_pdu(
392-
destinations=[pdu.origin],
393+
destinations=[pdu_origin],
393394
event_id=pdu.event_id,
394395
room_version=room_version,
395396
outlier=outlier,

0 commit comments

Comments
 (0)