summary refs log tree commit diff
path: root/synapse/events
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2017-09-27 11:24:19 +0100
committerDavid Baker <dave@matrix.org>2017-09-27 11:24:19 +0100
commitef3a5ae787e2fa25cc753b7c5dc9f31ba3bf4316 (patch)
treee2599991593707e460fafd1456655585a0148b82 /synapse/events
parentRemove unintentional debugging (diff)
downloadsynapse-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 '')
-rw-r--r--synapse/events/spamcheck.py8
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):