From: Pietro Cerutti Date: Mon, 14 Nov 2016 09:01:30 +0000 (+0000) Subject: Fix crash when doing collapse_all on an empty folder X-Git-Tag: neomutt-20161126~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=47f0710d55594407b19e8e395e136768127fae8d;p=neomutt Fix crash when doing collapse_all on an empty folder Closes: #230 --- diff --git a/curs_main.c b/curs_main.c index c46a2782b..3b3ce625a 100644 --- a/curs_main.c +++ b/curs_main.c @@ -144,6 +144,9 @@ static void collapse_all(MUTTMENU *menu, int toggle) THREAD *thread, *top; int final; + if (!Context || (Context->msgcount == 0)) + return; + /* Figure out what the current message would be after folding / unfolding, * so that we can restore the cursor in a sane way afterwards. */ if (CURHDR->collapsed && toggle)