From 1d0f918eff7fe02a9fbef8881959b15d6b3796cb Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Mon, 15 Nov 2021 14:51:05 +0000 Subject: [PATCH] db: thread: Fix LookupError when no header(subject) 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 --- alot/db/thread.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alot/db/thread.py b/alot/db/thread.py index 56b6d0d04..048c00e36 100644 --- a/alot/db/thread.py +++ b/alot/db/thread.py @@ -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