aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornico <nico@magicbroccoli.de>2019-05-15 09:43:19 +0200
committernico <nico@magicbroccoli.de>2019-05-15 09:43:19 +0200
commit2b0a8051df94d998ff40a678823dd21a6991c4c4 (patch)
tree8edf03bd2d414ec480add9f91751d81109565180
parent426ecef4a572b1f9feeb3c62d4bc01e726e77ae7 (diff)
body tag NoneType fix
+ add None catch to body tag filter
-rwxr-xr-xmain.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/main.py b/main.py
index e86faf4..9df8739 100755
--- a/main.py
+++ b/main.py
@@ -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(