1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-25 00:58:50 -05:00

Don't choke on invalid size parameters for attachment parts

This commit is contained in:
cketti 2012-02-27 20:29:22 +01:00
parent 2cb31a2fac
commit 25dff5ae6a

View File

@ -155,7 +155,13 @@ public class AttachmentView extends FrameLayout {
mController = controller; mController = controller;
mListener = listener; mListener = listener;
size = Integer.parseInt(MimeUtility.getHeaderParameter(contentDisposition, "size")); String sizeParam = MimeUtility.getHeaderParameter(contentDisposition, "size");
if (sizeParam != null) {
try {
size = Integer.parseInt(sizeParam);
} catch (NumberFormatException e) { /* ignore */ }
}
contentType = MimeUtility.getMimeTypeForViewing(part.getMimeType(), name); contentType = MimeUtility.getMimeTypeForViewing(part.getMimeType(), name);
TextView attachmentName = (TextView) findViewById(R.id.attachment_name); TextView attachmentName = (TextView) findViewById(R.id.attachment_name);
TextView attachmentInfo = (TextView) findViewById(R.id.attachment_info); TextView attachmentInfo = (TextView) findViewById(R.id.attachment_info);