1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-04 06:20:26 +00:00

Simplification/fix

This commit is contained in:
M66B 2020-04-06 18:42:02 +02:00
parent cb084cb99b
commit e4f9665ef0

View file

@ -1873,17 +1873,16 @@ public class MessageHelper {
ContentType contentType; ContentType contentType;
try { try {
String c = part.getContentType(); contentType = new ContentType(part.getContentType());
contentType = new ContentType(
TextUtils.isEmpty(c) ? "application/octet-stream" : c);
} catch (ParseException ex) { } catch (ParseException ex) {
Log.e(ex); Log.w(ex);
parts.warnings.add(Log.formatThrowable(ex, false));
if (part instanceof MimeMessage) if (part instanceof MimeMessage)
contentType = new ContentType("text/html"); contentType = new ContentType("text/html");
else else
contentType = new ContentType(Helper.guessMimeType(filename)); contentType = new ContentType(Helper.guessMimeType(filename));
Log.i("Content type guessed=" + contentType);
} }
boolean plain = "text/plain".equalsIgnoreCase(contentType.getBaseType()); boolean plain = "text/plain".equalsIgnoreCase(contentType.getBaseType());