mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-14 10:03:47 +01:00
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
This commit is contained in:
parent
8c06dd6071
commit
ef3a5ae787
1 changed files with 7 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue