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