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)) {
// 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) {