Fix Tags app NPE.
mimeType parser can return null on some types.
Change-Id: I8bd8d9674686bcbdec47410d5f6700c6483a53db
diff --git a/src/com/android/apps/tag/record/ImageRecord.java b/src/com/android/apps/tag/record/ImageRecord.java
index 34af2ee..95eb329 100644
--- a/src/com/android/apps/tag/record/ImageRecord.java
+++ b/src/com/android/apps/tag/record/ImageRecord.java
@@ -52,6 +52,9 @@
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