fa40b0
diff -ur mutt-1.7.0-orig/imap/imap.c mutt-1.7.0/imap/imap.c
fa40b0
--- mutt-1.7.0-orig/imap/imap.c	2016-08-20 11:06:26.266272415 +0100
fa40b0
+++ mutt-1.7.0/imap/imap.c	2016-08-20 11:07:42.874509429 +0100
fa40b0
@@ -1143,7 +1143,7 @@
fa40b0
   if (!idata->ctx)
fa40b0
     return -1;
fa40b0
 
fa40b0
-  if (!mutt_bit_isset (idata->ctx->rights, right))
fa40b0
+  if (!idata->ctx || !mutt_bit_isset (idata->ctx->rights, right))
fa40b0
     return 0;
fa40b0
 
fa40b0
   if (right == MUTT_ACL_WRITE && !imap_has_flag (idata->flags, name))