From ba87eb675334b22f312849186089a1d53dd0fbb6 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Thu, 25 Sep 2014 14:45:15 +0100 Subject: Fix bug where we tried to insert state events with null state key --- synapse/storage/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'synapse') 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, -- cgit 1.4.1