]> git.mxchange.org Git - pizzaservice-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:24 +0000 (19:28 +0200)
- wrong bait, wrong fish, wrong test ...

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

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