Skip to content

Commit

Permalink
handler/sync: Handle batches without events
Browse files Browse the repository at this point in the history
Check if the batch contains events before trying to access them.

Fixes matrix-org#4842
  • Loading branch information
jo-so committed Mar 25, 2019
1 parent 31c536e commit e9877c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion synapse/handlers/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down

0 comments on commit e9877c8

Please sign in to comment.