From: Richard Russon Date: Sun, 2 Dec 2018 12:05:41 +0000 (+0000) Subject: check context before using mailbox X-Git-Tag: 2019-10-25~470 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ff314a52264f1954799cf016cf6e170120e2e89d;p=neomutt check context before using mailbox --- diff --git a/hook.c b/hook.c index 743189e93..d2922dd61 100644 --- a/hook.c +++ b/hook.c @@ -502,8 +502,8 @@ static int addr_hook(char *path, size_t pathlen, int type, struct Context *ctx, if (hook->type & type) { - if ((mutt_pattern_exec(hook->pattern, 0, ctx->mailbox, e, &cache) > 0) ^ - hook->regex.not) + struct Mailbox *m = ctx ? ctx->mailbox : NULL; + if ((mutt_pattern_exec(hook->pattern, 0, m, e, &cache) > 0) ^ hook->regex.not) { mutt_make_string_flags(path, pathlen, hook->command, ctx, e, MUTT_FORMAT_PLAIN); return 0;