From: Roland Häder Date: Sat, 10 Jun 2017 19:51:54 +0000 (+0200) Subject: Please cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=24b36206a5f5bbbd74222a040c7a8a7a3fb31d13;p=addressbook-ejb.git Please cherry-pick: - no gender, there is "personal title" for Mr./Mrs. Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/jusercore/model/user/AddressbookUserSessionBean.java b/src/java/org/mxchange/jusercore/model/user/AddressbookUserSessionBean.java index ff8b1e3..3ab279d 100644 --- a/src/java/org/mxchange/jusercore/model/user/AddressbookUserSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/user/AddressbookUserSessionBean.java @@ -613,6 +613,18 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl // Not valid throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is not valid", user.getUserId())); //NOI18N } else if (user.getUserAccountStatus() == null) { + // Throw NPE + throw new NullPointerException("user.userAccountStatus is null"); //NOI18N + } else if (user.getUserContact() == null) { + // Throw it again + throw new NullPointerException("user.userContact is null"); //NOI18N + } else if (user.getUserContact().getContactId() == null) { + // .. and again + throw new NullPointerException("user.userContact.contactId is null"); //NOI18N + } else if (user.getUserContact().getContactId() < 1) { + // Invalid id + throw new IllegalArgumentException(MessageFormat.format("user.userContact.contactId={0} is invalid", user.getUserContact().getContactId())); //NOI18N + } else if (user.getUserContact().getContactPersonalTitle() == null) { // Throw NPE again throw new NullPointerException("user.userAccountStatus is null"); //NOI18N } else if (!this.ifUserExists(user)) {