From 23fb491075d9ca51c4ec228a8a166e90e1d8bcaf 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/JobsAdminUserSessionBean.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/java/org/mxchange/jusercore/model/user/JobsAdminUserSessionBean.java b/src/java/org/mxchange/jusercore/model/user/JobsAdminUserSessionBean.java index 5b7eb69..dd94cb0 100644 --- a/src/java/org/mxchange/jusercore/model/user/JobsAdminUserSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/user/JobsAdminUserSessionBean.java @@ -118,9 +118,12 @@ public class JobsAdminUserSessionBean extends BaseJobsDatabaseBean implements Ad 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