From: Roland Häder Date: Thu, 20 Oct 2022 03:44:06 +0000 (+0200) Subject: Please cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=542b4f6644493ab748df66a4d525faf688777507;p=addressbook-ejb.git Please cherry-pick: - added check for parameter "baseUrl" (null and empty) --- diff --git a/src/java/org/mxchange/addressbook/enterprise/BaseAddressbookEnterpriseBean.java b/src/java/org/mxchange/addressbook/enterprise/BaseAddressbookEnterpriseBean.java index 361b58b..57d7c9e 100644 --- a/src/java/org/mxchange/addressbook/enterprise/BaseAddressbookEnterpriseBean.java +++ b/src/java/org/mxchange/addressbook/enterprise/BaseAddressbookEnterpriseBean.java @@ -1045,6 +1045,12 @@ public abstract class BaseAddressbookEnterpriseBean extends BaseEnterpriseBean { } else if (this.getSession() == null) { // Throw NPE throw new NullPointerException("this.session is not set. Have you forgotten to call super(String, String) and called only super() ?"); //NOI18N + } else if (null == baseUrl) { + // Throw NPE again + throw new NullPointerException("baseUrl is null"); //NOI18N + } else if (baseUrl.isEmpty()) { + // Throw IAE + throw new IllegalArgumentException("baseUrl is empty"); //NOI18N } // Set all values diff --git a/src/java/org/mxchange/jusercore/model/user/AddressbookAdminUserSessionBean.java b/src/java/org/mxchange/jusercore/model/user/AddressbookAdminUserSessionBean.java index 514aae9..7220780 100644 --- a/src/java/org/mxchange/jusercore/model/user/AddressbookAdminUserSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/user/AddressbookAdminUserSessionBean.java @@ -238,6 +238,12 @@ public class AddressbookAdminUserSessionBean extends BaseAddressbookEnterpriseBe } else if (userLockReason.isEmpty()) { // Is empty throw new IllegalArgumentException("userLockReason is empty"); //NOI18N + } else if (null == baseUrl) { + // Throw NPE again + throw new NullPointerException("baseUrl is null"); //NOI18N + } else if (baseUrl.isEmpty()) { + // Throw IAE + throw new IllegalArgumentException("baseUrl is empty"); //NOI18N } // Remove contact instance as this is not updated @@ -299,6 +305,12 @@ public class AddressbookAdminUserSessionBean extends BaseAddressbookEnterpriseBe } else if (user.getUserAccountStatus() == UserAccountStatus.UNCONFIRMED) { // Account is unconfirmed throw new UserStatusUnconfirmedException(user); + } else if (null == baseUrl) { + // Throw NPE again + throw new NullPointerException("baseUrl is null"); //NOI18N + } else if (baseUrl.isEmpty()) { + // Throw IAE + throw new IllegalArgumentException("baseUrl is empty"); //NOI18N } // Remove contact instance as this is not updated diff --git a/src/java/org/mxchange/jusercore/model/user/email_address/AddressbookUserEmailChangeSessionBean.java b/src/java/org/mxchange/jusercore/model/user/email_address/AddressbookUserEmailChangeSessionBean.java index f80cc89..21d68bb 100644 --- a/src/java/org/mxchange/jusercore/model/user/email_address/AddressbookUserEmailChangeSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/user/email_address/AddressbookUserEmailChangeSessionBean.java @@ -81,6 +81,12 @@ public class AddressbookUserEmailChangeSessionBean extends BaseAddressbookEnterp } else if (this.isEmailAddressEnqueued(emailChange.getEmailAddress())) { // Email address is already enqueued throw new EJBException(MessageFormat.format("Email address {0} is already enqueued.", emailChange.getEmailAddress())); //NOI18N + } else if (null == baseUrl) { + // Throw NPE again + throw new NullPointerException("baseUrl is null"); //NOI18N + } else if (baseUrl.isEmpty()) { + // Throw IAE + throw new IllegalArgumentException("baseUrl is empty"); //NOI18N } // The email change is not (yet) there, add secure hash and "created" timestamp diff --git a/src/java/org/mxchange/juserlogincore/model/user/register/AddressbookUserRegistrationSessionBean.java b/src/java/org/mxchange/juserlogincore/model/user/register/AddressbookUserRegistrationSessionBean.java index 563c015..4d5ad00 100644 --- a/src/java/org/mxchange/juserlogincore/model/user/register/AddressbookUserRegistrationSessionBean.java +++ b/src/java/org/mxchange/juserlogincore/model/user/register/AddressbookUserRegistrationSessionBean.java @@ -129,6 +129,12 @@ public class AddressbookUserRegistrationSessionBean extends BaseAddressbookEnter } else if (user.getUserContact().getContactEmailAddress().isEmpty()) { // Is empty throw new IllegalArgumentException("user.userContact.contactEmailAddress is empty"); //NOI18N + } else if (null == baseUrl) { + // Throw NPE again + throw new NullPointerException("baseUrl is null"); //NOI18N + } else if (baseUrl.isEmpty()) { + // Throw IAE + throw new IllegalArgumentException("baseUrl is empty"); //NOI18N } // Check if user is registered diff --git a/src/java/org/mxchange/juserlogincore/model/user/resendlink/AddressbookResendLinkSessionBean.java b/src/java/org/mxchange/juserlogincore/model/user/resendlink/AddressbookResendLinkSessionBean.java index 748d340..256d03e 100644 --- a/src/java/org/mxchange/juserlogincore/model/user/resendlink/AddressbookResendLinkSessionBean.java +++ b/src/java/org/mxchange/juserlogincore/model/user/resendlink/AddressbookResendLinkSessionBean.java @@ -93,6 +93,12 @@ public class AddressbookResendLinkSessionBean extends BaseAddressbookEnterpriseB } else if (null == locale) { // Locale should be set throw new NullPointerException("locale is null"); //NOI18N + } else if (null == baseUrl) { + // Throw NPE again + throw new NullPointerException("baseUrl is null"); //NOI18N + } else if (baseUrl.isEmpty()) { + // Throw IAE + throw new IllegalArgumentException("baseUrl is empty"); //NOI18N } // Get new registration key