]> git.mxchange.org Git - jfinancials-war.git/commitdiff
Added check for parameter, to make sure only valid can pass
authorRoland Häder <roland@mxchange.org>
Tue, 19 Apr 2016 12:26:24 +0000 (14:26 +0200)
committerRoland Haeder <roland@mxchange.org>
Tue, 19 Apr 2016 18:26:06 +0000 (20:26 +0200)
Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebSessionBean.java

index afd96c373de0dad27948f97e5ecac51159a392fd..7affb06450723ee538f8365c4f490d030afc087a 100644 (file)
@@ -601,6 +601,14 @@ public class AddressbookAdminUserWebSessionBean implements AddressbookAdminUserW
 
        @Override
        public User lookupUserById (final Long userId) throws UserNotFoundException {
+               if (null == userId) {
+                       // Throw NPE
+                       throw new NullPointerException("userId is null"); //NOI18N
+               } else if (userId < 1) {
+                       // Not valid
+                       throw new IllegalArgumentException(MessageFormat.format("userId={0} is not valid.", userId)); //NOI18N
+               }
+
                // Init variable
                User user = null;