Small improvement

pull/156/head
M66B 6 years ago
parent 3592bea8a8
commit 60dd38d822

@ -976,14 +976,15 @@ public class MessageHelper {
try { try {
if (part.isMimeType("multipart/*")) { if (part.isMimeType("multipart/*")) {
Multipart multipart; Multipart multipart;
final Object content = part.getContent(); Object content = part.getContent();
if (content instanceof Multipart) if (content instanceof Multipart)
multipart = (Multipart) part.getContent(); multipart = (Multipart) part.getContent();
else { else if (content instanceof String) {
String text = (String) content; String text = (String) content;
String sample = text.substring(0, Math.min(80, text.length())); String sample = text.substring(0, Math.min(80, text.length()));
throw new ParseException(content.getClass().getName() + ": " + sample); throw new ParseException(content.getClass().getName() + ": " + sample);
} } else
throw new ParseException(content.getClass().getName());
for (int i = 0; i < multipart.getCount(); i++) for (int i = 0; i < multipart.getCount(); i++)
try { try {

Loading…
Cancel
Save