From 56eb61ff38dcc42ee47c9c85dda430f08861c888 Mon Sep 17 00:00:00 2001 From: Pietro Cerutti Date: Thu, 2 May 2019 12:42:29 +0000 Subject: [PATCH] Fix crash when trying to collapse a limit not matching any messages This is a follow-up of #1685 --- index.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.c b/index.c index 52206efbd..1ab37ae0e 100644 --- a/index.c +++ b/index.c @@ -254,6 +254,9 @@ static void collapse_all(struct Menu *menu, int toggle) else final = CUR_EMAIL->virtual; + if (final == -1) + return; + base = Context->mailbox->emails[Context->mailbox->v2r[final]]; /* Iterate all threads, perform collapse/uncollapse as needed */ -- 2.40.0