if (data & (M_SENDHOOK | M_SEND2HOOK | M_SAVEHOOK | M_FCCHOOK | M_MESSAGEHOOK | M_REPLYHOOK))
{
if ((pat = mutt_pattern_comp (pattern.data,
- (data & (M_SENDHOOK | M_SEND2HOOK | M_FCCHOOK | M_REPLYHOOK)) ? 0 : M_FULL_MSG,
+ (data & (M_SENDHOOK | M_SEND2HOOK | M_FCCHOOK)) ? 0 : M_FULL_MSG,
err)) == NULL)
goto error;
}
case M_BODY:
case M_HEADER:
case M_WHOLE_MSG:
+ /*
+ * ctx can be NULL in certain cases, such as when replying to a message from the attachment menu and
+ * the user has a reply-hook using "~h" (bug #2190).
+ */
+ if (!ctx)
+ return 0;
#ifdef USE_IMAP
/* IMAP search sets h->matched at search compile time */
if (ctx->magic == M_IMAP && pat->stringmatch)