summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-02-17 12:51:02 +0000
committerErik Johnston <erik@matrix.org>2016-02-17 12:51:02 +0000
commit200de164401ceb83fd9b0b32d27bf779cd268324 (patch)
tree809fe1ac9f22855ea2f8e5f170666859f96a2361 /synapse
parentMerge pull request #581 from Rugvip/event_id (diff)
parentapi/filtering: don't assume that event content will always be a dict (diff)
downloadsynapse-200de164401ceb83fd9b0b32d27bf779cd268324.tar.xz
Merge pull request #580 from Rugvip/develop
api/filtering: don't assume that event content will always be a dict
Diffstat (limited to 'synapse')
-rw-r--r--synapse/api/filtering.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/api/filtering.py b/synapse/api/filtering.py
index 6eff83e5f8..cd699ef27f 100644
--- a/synapse/api/filtering.py
+++ b/synapse/api/filtering.py
@@ -198,7 +198,10 @@ class Filter(object):
         sender = event.get("sender", None)
         if not sender:
             # Presence events have their 'sender' in content.user_id
-            sender = event.get("content", {}).get("user_id", None)
+            content = event.get("content")
+            # account_data has been allowed to have non-dict content, so check type first
+            if isinstance(content, dict):
+                sender = content.get("user_id")
 
         return self.check_fields(
             event.get("room_id", None),