1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-02-24 07:01:05 +00:00

Catch TNEF attachment errors

This commit is contained in:
M66B 2020-12-04 13:25:25 +01:00
parent fc80a35ef2
commit 6c9d0bb938

View file

@ -2165,7 +2165,8 @@ public class MessageHelper {
db.attachment().setDownloaded(attachment.id, (long) body.length());
}
for (org.apache.poi.hmef.Attachment at : msg.getAttachments()) {
for (org.apache.poi.hmef.Attachment at : msg.getAttachments())
try {
String filename = at.getLongFilename();
if (filename == null)
filename = at.getFilename();
@ -2190,6 +2191,9 @@ public class MessageHelper {
}
db.attachment().setDownloaded(attachment.id, (long) data.length);
} catch (Throwable ex) {
// java.lang.IllegalArgumentException: Attachment corrupt - no Data section
Log.e(ex);
}
StringBuilder sb = new StringBuilder();