From 8703dade1c3915d0e89a52bab0618368cfeb4b4a Mon Sep 17 00:00:00 2001 From: "bienvenu%nventure.com" Date: Mon, 8 Mar 2004 17:31:18 +0000 Subject: [PATCH] fix crash generating mdn receipt when original message has no message-id sr=mscott 224738 --- mailnews/extensions/mdn/src/nsMsgMdnGenerator.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/mailnews/extensions/mdn/src/nsMsgMdnGenerator.cpp b/mailnews/extensions/mdn/src/nsMsgMdnGenerator.cpp index 7fc4f5d96f3..1ac81e61089 100644 --- a/mailnews/extensions/mdn/src/nsMsgMdnGenerator.cpp +++ b/mailnews/extensions/mdn/src/nsMsgMdnGenerator.cpp @@ -598,12 +598,14 @@ nsresult nsMsgMdnGenerator::CreateFirstPart() m_headers->ExtractHeader(HEADER_MESSAGE_ID, PR_FALSE, getter_Copies(m_messageId)); - if (*m_messageId.get() == '<') - tmpBuffer = PR_smprintf("References: %s" CRLF, m_messageId.get()); - else - tmpBuffer = PR_smprintf("References: <%s>" CRLF, m_messageId.get()); - PUSH_N_FREE_STRING(tmpBuffer); - + if (!m_messageId.IsEmpty()) + { + if (*m_messageId.get() == '<') + tmpBuffer = PR_smprintf("References: %s" CRLF, m_messageId.get()); + else + tmpBuffer = PR_smprintf("References: <%s>" CRLF, m_messageId.get()); + PUSH_N_FREE_STRING(tmpBuffer); + } tmpBuffer = PR_smprintf("%s" CRLF, "MIME-Version: 1.0"); PUSH_N_FREE_STRING(tmpBuffer);