diff options
author | nico <nico@magicbroccoli.de> | 2019-05-15 09:43:19 +0200 |
---|---|---|
committer | nico <nico@magicbroccoli.de> | 2019-05-15 09:43:19 +0200 |
commit | 2b0a8051df94d998ff40a678823dd21a6991c4c4 (patch) | |
tree | 8edf03bd2d414ec480add9f91751d81109565180 | |
parent | 426ecef4a572b1f9feeb3c62d4bc01e726e77ae7 (diff) |
body tag NoneType fix
+ add None catch to body tag filter
-rwxr-xr-x | main.py | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -83,7 +83,9 @@ class AbuseReport: spam_time = message_parsed.find('.//{urn:xmpp:delay}delay').get('stamp') # body - spam_body = message_parsed.find('{jabber:client}body').text + spam_body = message_parsed.find('{jabber:client}body') + if spam_body is not None: + spam_body = spam_body.text # format sql sql = 'INSERT INTO spam("user", "domain", "ts", "message") VALUES("{}", "{}", "{}", "{}");'.format( |