]> granicus.if.org Git - neomutt/commitdiff
Fix sidebar crash for non-existent mailbox
authorRichard Russon <rich@flatcap.org>
Wed, 6 Jul 2016 19:31:02 +0000 (12:31 -0700)
committerRichard Russon <rich@flatcap.org>
Wed, 6 Jul 2016 19:31:02 +0000 (12:31 -0700)
If you <change-folder> to a non-existent mailbox, there will be no
Context.

sidebar.c

index 12971e521e423e4abf7fc82ce348331a77482f42..3c2d9c03e51d15cc22bdcea67fb34ccf6ab86d32 100644 (file)
--- a/sidebar.c
+++ b/sidebar.c
@@ -886,6 +886,9 @@ void mutt_sb_set_open_buffy (void)
 
   OpnIndex = -1;
 
+  if (!Context)
+    return;
+
   for (entry = 0; entry < EntryCount; entry++)
   {
     if (!mutt_strcmp (Entries[entry]->buffy->realpath, Context->realpath))