From e457aa10c5101c19bd1fb8832f07b0c0a00ae23d Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Wed, 7 Oct 2015 13:55:30 +0200 Subject: [PATCH] =?utf8?q?need=20to=20set=20userId=20again=20...=20;-)=20S?= =?utf8?q?igned-off-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../addressbook/beans/register/UserRegisterWebBean.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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) { -- 2.39.5