summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2017-10-10 15:34:05 +0100
committerDavid Baker <dave@matrix.org>2017-10-10 15:34:05 +0100
commitab1bc9bf5fcc8875c61e4ec7357d6e43abc76a55 (patch)
tree027f5dfd28dab19d8e93b94553f076e3e2d502b5 /synapse
parentUse notification levels in power_levels (diff)
downloadsynapse-ab1bc9bf5fcc8875c61e4ec7357d6e43abc76a55.tar.xz
Don't KeyError if no power_levels event
Diffstat (limited to 'synapse')
-rw-r--r--synapse/push/bulk_push_rule_evaluator.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/push/bulk_push_rule_evaluator.py b/synapse/push/bulk_push_rule_evaluator.py
index db07a97a94..05c1c5165f 100644
--- a/synapse/push/bulk_push_rule_evaluator.py
+++ b/synapse/push/bulk_push_rule_evaluator.py
@@ -131,7 +131,9 @@ class BulkPushRuleEvaluator(object):
 
         sender_level = get_user_power_level(event.sender, auth_events)
 
-        defer.returnValue((auth_events[POWER_KEY].content, sender_level))
+        pl_event = auth_events.get(POWER_KEY)
+
+        defer.returnValue((pl_event.content if pl_event else {}, sender_level))
 
     @defer.inlineCallbacks
     def action_for_event_by_user(self, event, context):