mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-02-04 21:13:54 +01:00
Fix validity check with gender and type
This commit is contained in:
parent
29cc364f8a
commit
60210e069c
@ -31,7 +31,7 @@ public class UserInfo {
|
|||||||
* @throws IllegalArgumentException when the given values are not valid
|
* @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 {
|
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");
|
throw new IllegalArgumentException("Invalid parameters");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user