Noticed we should just use BarcodeFormat constants in the client for simplicity
[zxing.git] / core / src / com / google / zxing / BarcodeFormat.java
index 9820c09..360baf7 100644 (file)
@@ -78,6 +78,9 @@ public final class BarcodeFormat {
   }
 
   public static BarcodeFormat valueOf(String name) {
+    if (name == null || name.length() == 0) {
+      throw new IllegalArgumentException();
+    }
     BarcodeFormat format = (BarcodeFormat) VALUES.get(name);
     if (format == null) {
       throw new IllegalArgumentException();