do not try to attach an empty file

This commit is contained in:
Karol Wypchlo 2021-03-03 14:34:27 +01:00
parent 44b7a85285
commit a16b724583
1 changed files with 1 additions and 1 deletions

View File

@ -97,7 +97,7 @@ async def send_msg(client, msg, force_notify=False, file=None):
# Add the portal name.
msg = "**{}**: {}".format(portal_name, msg)
if isinstance(file, str):
if file and isinstance(file, str):
is_json = is_json_string(file)
content_type = "application/json" if is_json else "text/plain"
ext = "json" if is_json else "txt"