]> git.mxchange.org Git - jjobs-ejb.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Mon, 29 Aug 2016 10:49:11 +0000 (12:49 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 29 Aug 2016 17:28:32 +0000 (19:28 +0200)
- wrong bait, wrong fish, wrong test ...

src/java/org/mxchange/jusercore/model/user/JobsAdminUserSessionBean.java

index 5b7eb69104a99660d5d8f41c6be71d0389c9f591..dd94cb0d7a2d042ff81a7f43bb28a600332425e5 100644 (file)
@@ -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