Don't choke on invalid size parameters for attachment parts
This commit is contained in:
parent
2cb31a2fac
commit
25dff5ae6a
1 changed files with 7 additions and 1 deletions
|
@ -155,7 +155,13 @@ public class AttachmentView extends FrameLayout {
|
|||
mController = controller;
|
||||
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);
|
||||
TextView attachmentName = (TextView) findViewById(R.id.attachment_name);
|
||||
TextView attachmentInfo = (TextView) findViewById(R.id.attachment_info);
|
||||
|
|
Loading…
Reference in a new issue