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
}
/* 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 */