diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-06-15 16:20:34 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-15 16:20:34 -0400 |
commit | cc32fa7358641b96f5d3dbc14d0cd068e676e256 (patch) | |
tree | d28b909bbef0a82e61ca5924e8a5400ef115d673 /synapse/push/push_rule_evaluator.py | |
parent | Ensure etag is a string for GET room_keys/version response (#7691) (diff) | |
download | synapse-cc32fa7358641b96f5d3dbc14d0cd068e676e256.tar.xz |
Ensure the body is a string before comparing push rules. (#7701)
Diffstat (limited to 'synapse/push/push_rule_evaluator.py')
-rw-r--r-- | synapse/push/push_rule_evaluator.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/push/push_rule_evaluator.py b/synapse/push/push_rule_evaluator.py index 11032491af..aeac257a6e 100644 --- a/synapse/push/push_rule_evaluator.py +++ b/synapse/push/push_rule_evaluator.py @@ -131,7 +131,7 @@ class PushRuleEvaluatorForEvent(object): # XXX: optimisation: cache our pattern regexps if condition["key"] == "content.body": body = self._event.content.get("body", None) - if not body: + if not body or not isinstance(body, str): return False return _glob_matches(pattern, body, word_boundary=True) @@ -147,7 +147,7 @@ class PushRuleEvaluatorForEvent(object): return False body = self._event.content.get("body", None) - if not body: + if not body or not isinstance(body, str): return False # Similar to _glob_matches, but do not treat display_name as a glob. |