Skip to content

Commit bbb0f6b

Browse files
committed
fix(autogist): empty files should not be uploaded
1 parent c026dfd commit bbb0f6b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

autogist/autogist.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,8 @@ async def on_message(self, message: discord.Message) -> None:
601601
author = message.author
602602

603603
filename, content = await fetch_attachment_from_message(message)
604-
if content is None:
604+
if not content:
605+
# content could not be decoded (is None) *or* the file is empty (== "")
605606
return
606607

607608
try:

0 commit comments

Comments
 (0)