Rocco Rutte:
[apps/madmutt.git] / imap / imap.c
index 110486e..76d9f8b 100644 (file)
@@ -1017,7 +1017,7 @@ int imap_sync_mailbox (CONTEXT * ctx, int expunge, int *index_hint)
       /* if the message has been rethreaded or attachments have been deleted
        * we delete the message and reupload it.
        * This works better if we're expunging, of course. */
-      if (ctx->hdrs[n]->refs_changed || ctx->hdrs[n]->irt_changed ||
+      if ((ctx->hdrs[n]->env && (ctx->hdrs[n]->env->refs_changed || ctx->hdrs[n]->env->irt_changed)) ||
           ctx->hdrs[n]->attach_del) {
         debug_print (3, ("Attachments to be deleted, falling back to _mutt_save_message\n"));
         if (!appendctx)