- Fixed a crash when parsing a particular VCard with a blank entry.
[zxing.git] / core / src / com / google / zxing / client / result / AddressBookDoCoMoResultParser.java
index 7bf88e6..ca1aba3 100644 (file)
@@ -35,16 +35,16 @@ final class AddressBookDoCoMoResultParser extends AbstractDoCoMoResultParser {
     if (rawText == null || !rawText.startsWith("MECARD:")) {
       return null;
     }
-    String[] rawName = matchDoCoMoPrefixedField("N:", rawText);
+    String[] rawName = matchDoCoMoPrefixedField("N:", rawText, true);
     if (rawName == null) {
       return null;
     }
     String name = parseName(rawName[0]);
-    String[] phoneNumbers = matchDoCoMoPrefixedField("TEL:", rawText);
-    String email = matchSingleDoCoMoPrefixedField("EMAIL:", rawText);
-    String note = matchSingleDoCoMoPrefixedField("NOTE:", rawText);
-    String address = matchSingleDoCoMoPrefixedField("ADR:", rawText);
-    String birthday = matchSingleDoCoMoPrefixedField("BDAY:", rawText);
+    String[] phoneNumbers = matchDoCoMoPrefixedField("TEL:", rawText, true);
+    String email = matchSingleDoCoMoPrefixedField("EMAIL:", rawText, true);
+    String note = matchSingleDoCoMoPrefixedField("NOTE:", rawText, false);
+    String address = matchSingleDoCoMoPrefixedField("ADR:", rawText, true);
+    String birthday = matchSingleDoCoMoPrefixedField("BDAY:", rawText, true);
     if (birthday != null && !isStringOfDigits(birthday, 8)) {
       return null;
     }