]> git.mxchange.org Git - addressbook-war.git/commitdiff
need to set userId again ... ;-)
authorRoland Haeder <roland@mxchange.org>
Wed, 7 Oct 2015 11:55:30 +0000 (13:55 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 7 Oct 2015 11:55:30 +0000 (13:55 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/java/org/mxchange/addressbook/beans/register/UserRegisterWebBean.java

index b3a752814513099579b7c016d63a62dcc9248c02..faaf79985d5d1de4611512c72afdfc5e76577283 100644 (file)
@@ -80,7 +80,10 @@ public class UserRegisterWebBean implements UserRegisterWebController {
                User user = this.userController.createUserInstance();
 
                // Is the user already used?
-               if (!this.userController.isRequiredPersonalDataSet()) {
+               if (null == user) {
+                       // user must be set
+                       throw new NullPointerException("user is null"); //NOI18N
+               } else if (!this.userController.isRequiredPersonalDataSet()) {
                        // Not all required fields are set
                        throw new FaceletException("Not all required fields are set."); //NOI18N
                } else if (this.userController.isUserNameRegistered(user)) {
@@ -119,6 +122,9 @@ public class UserRegisterWebBean implements UserRegisterWebController {
                        // Clear all data
                        this.userController.clearData();
 
+                       // Set user id again
+                       this.userController.setUserId(registeredUser.getUserId());
+
                        // All fine, redirect to proper page
                        return "register_done"; //NOI18N
                } catch (final UserNameAlreadyRegisteredException | EmailAddressAlreadyRegisteredException ex) {