Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gateway/platforms/email.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ async def connect(self) -> bool:
# Mark all existing messages as seen so we only process new ones
imap.select("INBOX")
status, data = imap.uid("search", None, "ALL")
if status == "OK" and data[0]:
if status == "OK" and data and data[0]:
for uid in data[0].split():
self._seen_uids.add(uid)
imap.logout()
Expand Down Expand Up @@ -295,7 +295,7 @@ def _fetch_new_messages(self) -> List[Dict[str, Any]]:
imap.select("INBOX")

status, data = imap.uid("search", None, "UNSEEN")
if status != "OK" or not data[0]:
if status != "OK" or not data or not data[0]:
imap.logout()
return results

Expand Down