fix mailbot crash:

File "/srv/ticketfrei/active_bots/mailbot.py", line 37, in post
    if rec not in report.author:
TypeError: argument of type 'NoneType' is not iterable
This commit is contained in:
b3yond 2018-10-26 18:20:01 +02:00
parent 8b36589557
commit 710a89c282

View file

@ -45,6 +45,10 @@ class TelegramBot(Bot):
"Send reports here to share them with other users. Use /start and /stop to get reports or not.")
# TODO: /help message should be set in frontend
else:
# set report.author to "" to avoid mailbot crash
if update.message.sender.username is None:
update.message.sender.username = ""
reports.append(Report(update.message.sender.username, self,
update.message.text, None,
update.message.date))