Skip to content

Commit 128a404

Browse files
committed
Handle missing events
1 parent e41a755 commit 128a404

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

synapse/handlers/sync.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1549,7 +1549,9 @@ async def _calculate_state_error(
15491549
async def event_id_to_membership(event_id: Optional[str]) -> Optional[str]:
15501550
if event_id is None:
15511551
return None
1552-
event = await self.store.get_event(event_id)
1552+
event = await self.store.get_event(event_id, allow_none=True)
1553+
if event is None:
1554+
return "MISSING_EVENT"
15531555
return event.membership
15541556

15551557
# Check for entries in the calculated state which differ from the actual state.

0 commit comments

Comments
 (0)