From a5d089777485e27d52025367d472cc3f605436a0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 29 Aug 2016 12:49:11 +0200 Subject: [PATCH] Please cherry-pick: - wrong bait, wrong fish, wrong test ... --- .../jusercore/model/user/PizzaAdminUserSessionBean.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 -- 2.39.5