mirror of
https://mau.dev/maunium/synapse.git
synced 2024-11-09 11:32:01 +01:00
Merge pull request #580 from Rugvip/develop
api/filtering: don't assume that event content will always be a dict
This commit is contained in:
commit
200de16440
1 changed files with 4 additions and 1 deletions
|
@ -198,7 +198,10 @@ class Filter(object):
|
||||||
sender = event.get("sender", None)
|
sender = event.get("sender", None)
|
||||||
if not sender:
|
if not sender:
|
||||||
# Presence events have their 'sender' in content.user_id
|
# 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(
|
return self.check_fields(
|
||||||
event.get("room_id", None),
|
event.get("room_id", None),
|
||||||
|
|
Loading…
Reference in a new issue