diff options
author | David Baker <dave@matrix.org> | 2017-09-27 11:24:19 +0100 |
---|---|---|
committer | David Baker <dave@matrix.org> | 2017-09-27 11:24:19 +0100 |
commit | ef3a5ae787e2fa25cc753b7c5dc9f31ba3bf4316 (patch) | |
tree | e2599991593707e460fafd1456655585a0148b82 /synapse/events/spamcheck.py | |
parent | Remove unintentional debugging (diff) | |
download | synapse-ef3a5ae787e2fa25cc753b7c5dc9f31ba3bf4316.tar.xz |
Don't test is spam_checker not None
Sometimes it's a Mock object which is not none but is still not what we're after
Diffstat (limited to 'synapse/events/spamcheck.py')
-rw-r--r-- | synapse/events/spamcheck.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/synapse/events/spamcheck.py b/synapse/events/spamcheck.py index 8ddbf2ca38..e739f105b2 100644 --- a/synapse/events/spamcheck.py +++ b/synapse/events/spamcheck.py @@ -18,8 +18,14 @@ class SpamChecker(object): def __init__(self, hs): self.spam_checker = None - if hs.config.spam_checker is not None: + module = None + config = None + try: module, config = hs.config.spam_checker + except: + pass + + if module is not None: self.spam_checker = module(config=config) def check_event_for_spam(self, event): |