mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-08-09 10:39:11 +02:00
fix: odysseus-mail read crashes on an empty IMAP fetch payload (#1730)
This commit is contained in:
parent
122b1077b8
commit
55b3537ce1
2 changed files with 64 additions and 1 deletions
|
|
@ -190,7 +190,7 @@ def cmd_read(args) -> None:
|
|||
if st != "OK":
|
||||
fail(f"select {args.folder!r} failed: {st}")
|
||||
st, msg_data = conn.fetch(args.uid.encode(), "(BODY.PEEK[])")
|
||||
if st != "OK":
|
||||
if st != "OK" or not msg_data or not msg_data[0]:
|
||||
fail(f"fetch UID {args.uid} failed: {st}")
|
||||
raw = msg_data[0][1]
|
||||
msg = email_mod.message_from_bytes(raw)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue