]> granicus.if.org Git - neomutt/commitdiff
fix mailbox crash
authorRichard Russon <rich@flatcap.org>
Tue, 2 Oct 2018 10:25:50 +0000 (11:25 +0100)
committerRichard Russon <rich@flatcap.org>
Tue, 2 Oct 2018 10:25:52 +0000 (11:25 +0100)
Mentioned in #1349
Thanks to @l29ah for the backtrace.

pager.c

diff --git a/pager.c b/pager.c
index e1935a82b88afafed9d00383cab00a2b18a044f4..b0a18fe25719fa125f62a68a9c6d730c0ad5336c 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -2334,9 +2334,9 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e
 
     bool do_new_mail = false;
 
-    if (Context && !OptAttachMsg)
+    if (Context && Context->mailbox && !OptAttachMsg)
     {
-      oldcount = Context ? Context->mailbox->msg_count : 0;
+      oldcount = Context->mailbox->msg_count;
       /* check for new mail */
       check = mx_mbox_check(Context, &index_hint);
       if (check < 0)