Commit 5f90b8ac authored by Martijn Coenen's avatar Martijn Coenen
Browse files

Fix Tags app NPE.

mimeType parser can return null on some types.

Change-Id: I8bd8d9674686bcbdec47410d5f6700c6483a53db
parent 1af0b4a0
......@@ -52,6 +52,9 @@ public class ImageRecord extends ParsedNdefRecord {
public static ImageRecord parse(NdefRecord record) {
String mimeType = record.toMimeType();
if (mimeType == null) {
throw new IllegalArgumentException("not a valid image file");
}
Preconditions.checkArgument(mimeType.startsWith("image/"));
// Try to ensure it's a legal, valid image
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment