From: Roland Häder Date: Mon, 29 Aug 2016 10:49:11 +0000 (+0200) Subject: Please cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a5d089777485e27d52025367d472cc3f605436a0;p=pizzaservice-ejb.git Please cherry-pick: - wrong bait, wrong fish, wrong test ... --- diff --git a/src/java/org/mxchange/jusercore/model/user/PizzaAdminUserSessionBean.java b/src/java/org/mxchange/jusercore/model/user/PizzaAdminUserSessionBean.java index debec57..5fb5923 100644 --- a/src/java/org/mxchange/jusercore/model/user/PizzaAdminUserSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/user/PizzaAdminUserSessionBean.java @@ -118,9 +118,12 @@ public class PizzaAdminUserSessionBean extends BasePizzaDatabaseBean implements if (null == user) { // Abort here throw new NullPointerException("user is null"); //NOI18N - } else if (user.getUserId() instanceof Long) { + } else if (user.getUserId() == null) { // Id is set - throw new IllegalArgumentException("user.userId is not null"); //NOI18N + throw new NullPointerException("user.userId is null"); //NOI18N + } else if (user.getUserId() < 1) { + // Not valid id number + throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is not valid", user.getUserId())); //NOI18N } else if (user.getUserContact() == null) { // Throw NPE again throw new NullPointerException("user.userContact is null"); //NOI18N