summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-09-25 14:45:15 +0100
committerErik Johnston <erik@matrix.org>2014-09-25 14:45:27 +0100
commitba87eb675334b22f312849186089a1d53dd0fbb6 (patch)
treead3a22f6f5ea6656f853a26fd05097d1580bc948
parentBF: Do a pagination when opening a room from an invitation (diff)
downloadsynapse-ba87eb675334b22f312849186089a1d53dd0fbb6.tar.xz
Fix bug where we tried to insert state events with null state key
-rw-r--r--synapse/storage/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/storage/__init__.py b/synapse/storage/__init__.py
index 66658f6721..1aaef3f493 100644
--- a/synapse/storage/__init__.py
+++ b/synapse/storage/__init__.py
@@ -217,7 +217,8 @@ class DataStore(RoomMemberStore, RoomStore,
             )
             raise _RollbackButIsFineException("_persist_event")
 
-        if is_new_state and hasattr(event, "state_key"):
+        is_state = hasattr(event, "state_key") and event.state_key is not None
+        if is_new_state and is_state:
             vals = {
                 "event_id": event.event_id,
                 "room_id": event.room_id,