Bug 1411737 - Fix crash when forwarding message with non-existent file in X-Mozilla-Cloud-Part header. r=jorgk CLOSED TREE
--- a/mailnews/mime/src/mimedrft.cpp
+++ b/mailnews/mime/src/mimedrft.cpp
@@ -1479,17 +1479,17 @@ mime_parse_stream_complete(nsMIMESession
//We cannot use this kind of data for the message body! Therefore, move it as attachment
bodyAsAttachment = true;
}
else
composeFormat = nsIMsgCompFormat::PlainText;
char *body = nullptr;
- if (!bodyAsAttachment)
+ if (!bodyAsAttachment && mdd->messageBody->m_tmpFile)
{
int64_t fileSize;
nsCOMPtr<nsIFile> tempFileCopy;
mdd->messageBody->m_tmpFile->Clone(getter_AddRefs(tempFileCopy));
mdd->messageBody->m_tmpFile = do_QueryInterface(tempFileCopy);
tempFileCopy = nullptr;
mdd->messageBody->m_tmpFile->GetFileSize(&fileSize);
uint32_t bodyLen = 0;