summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-08-10 10:08:15 +0100
committerErik Johnston <erik@matrix.org>2015-08-10 10:08:15 +0100
commitaa88582e008550aa5a341ebd8c31279a63074df9 (patch)
tree8ab597840cf8b6869345d4ab14a00f828ed69cba
parentLine length (diff)
downloadsynapse-aa88582e008550aa5a341ebd8c31279a63074df9.tar.xz
Do bounds check
Diffstat (limited to '')
-rw-r--r--synapse/storage/state.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/storage/state.py b/synapse/storage/state.py
index a193649852..06f0ab3ff6 100644
--- a/synapse/storage/state.py
+++ b/synapse/storage/state.py
@@ -433,7 +433,10 @@ class StateStore(SQLBaseStore):
                 key: None
                 for key in missing_types
             }
-            evs = [state_events[e_id] for e_id in state_ids]
+            evs = [
+                state_events[e_id] for e_id in state_ids
+                if e_id in state_events  # This can happen if event is rejected.
+            ]
             state_dict.update({
                 (e.type, e.state_key): e
                 for e in evs