Skip to content

Commit

Permalink
db: thread: Fix LookupError when no header(subject)
Browse files Browse the repository at this point in the history
Threads that do not have a subject will cause a LookupError() when
retrieving the header.

Catch this exception and set the subject to a null string.

Signed-off-by: Kieran Bingham <[email protected]>
  • Loading branch information
kbingham committed Dec 2, 2021
1 parent fbe59fa commit 1d0f918
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion alot/db/thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def _refresh(self, thread):
try:
first_msg = list(thread.toplevel())[0]
subject = first_msg.header('subject')
except IndexError:
except (IndexError, LookupError) as e:
subject = ''
self._subject = subject

Expand Down

0 comments on commit 1d0f918

Please sign in to comment.