diff options
author | Andrew Morgan <andrew@amorgan.xyz> | 2019-01-25 11:37:12 +0000 |
---|---|---|
committer | Andrew Morgan <andrew@amorgan.xyz> | 2019-01-25 11:37:12 +0000 |
commit | da0d2219d2bdde68165b16d51483357dd234ad1d (patch) | |
tree | 2c630971a9b22114c6ccf217786a0dd85799eab0 /synapse | |
parent | Use python magic (diff) | |
download | synapse-da0d2219d2bdde68165b16d51483357dd234ad1d.tar.xz |
Clean up direct_rooms access
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/handlers/room_member.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/handlers/room_member.py b/synapse/handlers/room_member.py index ee12428fe7..b9de146913 100644 --- a/synapse/handlers/room_member.py +++ b/synapse/handlers/room_member.py @@ -267,10 +267,10 @@ class RoomMemberHandler(object): ) # Copy direct message state if applicable - if user_account_data and "m.direct" in user_account_data: - direct_rooms = user_account_data["m.direct"] + direct_rooms = user_account_data.get("m.direct", {}) - # Check which key this room is under + # Check which key this room is under + if isinstance(direct_rooms, dict): for key, room_id_list in direct_rooms.items(): if old_room_id in room_id_list and new_room_id not in room_id_list: # Add new room_id to this key |