From: Pietro Cerutti <gahr@gahr.ch>
Date: Thu, 14 Dec 2017 07:47:31 +0000 (+0000)
Subject: Context might be NULL - avoid dereferencing it
X-Git-Tag: neomutt-20171215~4
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c2077ccfbb1a9df66bc433b727a13532ce7031b1;p=neomutt

Context might be NULL - avoid dereferencing it

Issue #999
---

diff --git a/sendlib.c b/sendlib.c
index dcc3081ad..9896901af 100644
--- a/sendlib.c
+++ b/sendlib.c
@@ -3143,7 +3143,7 @@ int mutt_write_fcc(const char *path, struct Header *hdr, const char *msgid,
 done:
   /* We ran a folder hook for the destination mailbox,
    * now we run it for the user's current mailbox */
-  if (Context->path)
+  if (Context && Context->path)
     mutt_folder_hook(Context->path);
 
   return rc;