From d4e5ba4051db7c4d3cd9a211753b77aca2ecf6ea Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 4 Aug 2016 11:50:46 +0200 Subject: [PATCH] Fixed: (please cherry-pick) - wrong check, opps, copy-paste mistake: user.userId must be valid set as the user is going to be linked with password history entry. --- .../LandingUserPasswordHistorySessionBean.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/java/org/mxchange/jusercore/model/user/password_history/LandingUserPasswordHistorySessionBean.java b/src/java/org/mxchange/jusercore/model/user/password_history/LandingUserPasswordHistorySessionBean.java index 1c78026..fa3461c 100644 --- a/src/java/org/mxchange/jusercore/model/user/password_history/LandingUserPasswordHistorySessionBean.java +++ b/src/java/org/mxchange/jusercore/model/user/password_history/LandingUserPasswordHistorySessionBean.java @@ -52,9 +52,12 @@ public class LandingUserPasswordHistorySessionBean extends BaseLandingDatabaseBe if (null == user) { // Abort here throw new NullPointerException("user is null"); //NOI18N - } else if (user.getUserId() != null) { - // Not allowed here - throw new IllegalStateException(MessageFormat.format("user.userId must be null, is: {0}", user.getUserId())); //NOI18N + } else if (user.getUserId() == null) { + // Throw NPE again + throw new NullPointerException("user.userId is null"); //NOI18N + } else if (user.getUserId() < 1) { + // Illegal id number + throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is not allowed.", user.getUserId())); //NOI18N } // Get named query -- 2.39.5