Catch TNEF attachment errors

pull/190/head
M66B 5 years ago
parent fc80a35ef2
commit 6c9d0bb938

@ -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();

Loading…
Cancel
Save