]> granicus.if.org Git - neomutt/commitdiff
check for empty Context
authorRichard Russon <rich@flatcap.org>
Thu, 22 Aug 2019 10:22:21 +0000 (11:22 +0100)
committerRichard Russon <rich@flatcap.org>
Thu, 22 Aug 2019 10:23:13 +0000 (11:23 +0100)
We'd already checked for an empty Context at the beginning of the `case`
statement, but we didn't check after any functions that might have
closed the Context.

Fixes: #1799
index.c

diff --git a/index.c b/index.c
index baeaf7309e25a3bb23df8ace01340daf26566858..9e67a2913c3e33996d60387facfdedebd8e2a409 100644 (file)
--- a/index.c
+++ b/index.c
@@ -1938,7 +1938,7 @@ int mutt_index_menu(void)
         }
 
         /* check for a fatal error, or all messages deleted */
-        if (mutt_buffer_is_empty(Context->mailbox->pathbuf))
+        if (Context && Context->mailbox && mutt_buffer_is_empty(Context->mailbox->pathbuf))
           ctx_free(&Context);
 
         /* if we were in the pager, redisplay the message */