From: Roland Haeder Date: Wed, 7 Oct 2015 11:55:30 +0000 (+0200) Subject: need to set userId again ... ;-) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e457aa10c5101c19bd1fb8832f07b0c0a00ae23d;p=addressbook-war.git need to set userId again ... ;-) Signed-off-by:Roland Häder --- diff --git a/src/java/org/mxchange/addressbook/beans/register/UserRegisterWebBean.java b/src/java/org/mxchange/addressbook/beans/register/UserRegisterWebBean.java index b3a75281..faaf7998 100644 --- a/src/java/org/mxchange/addressbook/beans/register/UserRegisterWebBean.java +++ b/src/java/org/mxchange/addressbook/beans/register/UserRegisterWebBean.java @@ -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) {