]> granicus.if.org Git - neomutt/commitdiff
Fix composing a new message
authorPietro Cerutti <gahr@gahr.ch>
Mon, 4 Mar 2019 10:10:40 +0000 (10:10 +0000)
committerPietro Cerutti <gahr@gahr.ch>
Mon, 4 Mar 2019 10:10:40 +0000 (10:10 +0000)
Fixes #1582

send.c

diff --git a/send.c b/send.c
index 466f27c80cfbb849ece40d024e23c4768d85e5d5..eb6a5fe5cc46e97375fae853aa04a28cac03207b 100644 (file)
--- a/send.c
+++ b/send.c
@@ -979,16 +979,19 @@ static int envelope_defaults(struct Envelope *env, struct Mailbox *m,
 static int generate_body(FILE *tempfp, struct Email *msg, SendFlags flags,
                          struct Mailbox *m, struct EmailList *el)
 {
-  if (!el || STAILQ_EMPTY(el))
-    return -1;
-
   enum QuadOption ans;
   struct Body *tmp = NULL;
   struct EmailNode *en = NULL;
   bool single = true;
 
-  en = STAILQ_FIRST(el);
-  single = !STAILQ_NEXT(en, entries);
+  if (el)
+    en = STAILQ_FIRST(el);
+  if (en)
+    single = !STAILQ_NEXT(en, entries);
+
+  /* An EmailList is required for replying and forwarding */
+  if (!el && (flags & (SEND_REPLY | SEND_FORWARD)))
+    return -1;
 
   if (flags & SEND_REPLY)
   {