Prevent crash on user who doesn't have any direct rooms

pull/4412/head
Andrew Morgan 2019-01-17 15:46:39 +00:00
parent 1f18c7cfc9
commit 887ca93a1b
1 changed files with 1 additions and 1 deletions

View File

@ -266,7 +266,7 @@ class RoomCreationHandler(BaseHandler):
user_id,
)
if user_account_data:
if user_account_data and "m.direct" in user_account_data[0]:
direct_rooms = user_account_data[0]["m.direct"]
# Check if this room was a DM
if old_room_id in direct_rooms[user_id]: