forked from ticketfrei/ticketfrei
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:
parent
3d869e57ac
commit
7a7d405072
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue