summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorRichard van der Hoff <github@rvanderhoff.org.uk>2017-10-17 20:53:30 +0100
committerGitHub <noreply@github.com>2017-10-17 20:53:30 +0100
commitb5dbbac3083f053632ac1c9accd0a6c60dc8dfe3 (patch)
treed60888ca955372cf6408efc87ad023022e4e0e99 /synapse
parentDoc some more dynamic Homeserver methods (diff)
parentFix 500 error when fields missing from power_levels event (diff)
downloadsynapse-b5dbbac3083f053632ac1c9accd0a6c60dc8dfe3.tar.xz
Merge pull request #2552 from matrix-org/rav/fix_500_on_dodgy_powerlevels
Fix 500 error when fields missing from power_levels event
Diffstat (limited to 'synapse')
-rw-r--r--synapse/event_auth.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/event_auth.py b/synapse/event_auth.py
index 4096c606f1..9e746a28bf 100644
--- a/synapse/event_auth.py
+++ b/synapse/event_auth.py
@@ -470,14 +470,14 @@ def _check_power_levels(event, auth_events):
         ("invite", None),
     ]
 
-    old_list = current_state.content.get("users")
+    old_list = current_state.content.get("users", {})
     for user in set(old_list.keys() + user_list.keys()):
         levels_to_check.append(
             (user, "users")
         )
 
-    old_list = current_state.content.get("events")
-    new_list = event.content.get("events")
+    old_list = current_state.content.get("events", {})
+    new_list = event.content.get("events", {})
     for ev_id in set(old_list.keys() + new_list.keys()):
         levels_to_check.append(
             (ev_id, "events")