summary refs log tree commit diff
path: root/synapse/storage/room.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-11-10 18:24:43 +0000
committerErik Johnston <erik@matrix.org>2014-11-10 18:25:42 +0000
commita8e565eca8cbfcedbdfd812c98a6545c2fc31afd (patch)
treed55fba621e45804cd27829415b0e588b7e9fa51c /synapse/storage/room.py
parentFix rest.test_events. Convert to use SQLiteMemoryDbPool (diff)
downloadsynapse-a8e565eca8cbfcedbdfd812c98a6545c2fc31afd.tar.xz
Add an EventValidator. Fix bugs in auth ++ storage
Diffstat (limited to 'synapse/storage/room.py')
-rw-r--r--synapse/storage/room.py38
1 files changed, 20 insertions, 18 deletions
diff --git a/synapse/storage/room.py b/synapse/storage/room.py
index ca70506d28..cc0513b8d2 100644
--- a/synapse/storage/room.py
+++ b/synapse/storage/room.py
@@ -133,26 +133,28 @@ class RoomStore(SQLBaseStore):
         defer.returnValue(ret)
 
     def _store_room_topic_txn(self, txn, event):
-        self._simple_insert_txn(
-            txn,
-            "topics",
-            {
-                "event_id": event.event_id,
-                "room_id": event.room_id,
-                "topic": event.topic,
-            }
-        )
+        if hasattr(event, "topic"):
+            self._simple_insert_txn(
+                txn,
+                "topics",
+                {
+                    "event_id": event.event_id,
+                    "room_id": event.room_id,
+                    "topic": event.topic,
+                }
+            )
 
     def _store_room_name_txn(self, txn, event):
-        self._simple_insert_txn(
-            txn,
-            "room_names",
-            {
-                "event_id": event.event_id,
-                "room_id": event.room_id,
-                "name": event.name,
-            }
-        )
+        if hasattr(event, "name"):
+            self._simple_insert_txn(
+                txn,
+                "room_names",
+                {
+                    "event_id": event.event_id,
+                    "room_id": event.room_id,
+                    "name": event.name,
+                }
+            )
 
 
 class RoomsTable(Table):