diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py index 57bb996245d5..4290c930a3f3 100644 --- a/synapse/handlers/sync.py +++ b/synapse/handlers/sync.py @@ -770,7 +770,7 @@ def compute_state_delta(self, room_id, batch, sync_config, since_token, now_toke current=current_state_ids, lazy_load_members=lazy_load_members, ) - elif batch.limited: + elif batch.limited and batch.events: state_at_timeline_start = yield self.store.get_state_ids_for_event( batch.events[0].event_id, state_filter=state_filter, )