]> granicus.if.org Git - neomutt/commitdiff
Fix crash when doing collapse_all on an empty folder
authorPietro Cerutti <gahr@gahr.ch>
Mon, 14 Nov 2016 09:01:30 +0000 (09:01 +0000)
committerRichard Russon <rich@flatcap.org>
Mon, 14 Nov 2016 11:16:34 +0000 (11:16 +0000)
Closes: #230
curs_main.c

index c46a2782b3a442eecfbd2325d24c3e3af6d567bc..3b3ce625ac592b8f2d81fb85998527089fa9f2ca 100644 (file)
@@ -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)