Fix validity check with gender and type

This commit is contained in:
cpfeiffer 2015-05-09 23:13:47 +02:00
parent 29cc364f8a
commit 60210e069c
1 changed files with 1 additions and 1 deletions

View File

@ -31,7 +31,7 @@ public class UserInfo {
* @throws IllegalArgumentException when the given values are not valid
*/
public static UserInfo create(String address, String alias, int gender, int age, int height, int weight, int type) throws IllegalArgumentException {
if (address == null || alias == null || gender <= 0 || age <= 0 || weight <= 0 || type <= 0) {
if (address == null || address.length() == 0 || alias == null || alias.length() == 0 || gender < 0 || age <= 0 || weight <= 0 || type < 0) {
throw new IllegalArgumentException("Invalid parameters");
}
try {