diff options
author | Richard van der Hoff <richard@matrix.org> | 2017-10-17 17:05:42 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2017-10-17 17:05:42 +0100 |
commit | c2bd177ea0e58d9831167273faa9bf9155466513 (patch) | |
tree | e481f56bccc1b8a3220835748b96db02d9c6bd86 /synapse/event_auth.py | |
parent | Improve error handling for missing files (#2551) (diff) | |
download | synapse-c2bd177ea0e58d9831167273faa9bf9155466513.tar.xz |
Fix 500 error when fields missing from power_levels event
If the users or events keys were missing from a power_levels event, then we would throw 500s when trying to auth them.
Diffstat (limited to 'synapse/event_auth.py')
-rw-r--r-- | synapse/event_auth.py | 6 |
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") |