mail message: multipart/alternative: avoid choosing the text/plain part if it is empty (yes it happens...)

This commit is contained in:
Jean-Francois Dockes 2017-03-26 17:39:49 +02:00
parent 3d48946bab
commit 9d95de032d

View File

@ -465,12 +465,13 @@ void MimeHandlerMail::walkmime(Binc::MimePart* doc, int depth)
else if (!stringlowercmp("text/html", content_type.value)) else if (!stringlowercmp("text/html", content_type.value))
ithtml = it; ithtml = it;
} }
if (ittxt != doc->members.end()) { if (ittxt != doc->members.end() && ittxt->bodylength) {
LOGDEB2("walkmime: alternative: chose text/plain part\n"); LOGDEB2("walkmime: alternative: choose text/plain. Size: " <<
walkmime(&(*ittxt), depth); ittxt->bodylength << endl);
walkmime(&(*ittxt), depth);
} else if (ithtml != doc->members.end()) { } else if (ithtml != doc->members.end()) {
LOGDEB2("walkmime: alternative: chose text/html part\n"); LOGDEB2("walkmime: alternative: choose text/html.\n");
walkmime(&(*ithtml), depth); walkmime(&(*ithtml), depth);
} }
} }
return; return;