]> git.mxchange.org Git - addressbook-ejb.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Thu, 20 Oct 2022 03:44:06 +0000 (05:44 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 20 Oct 2022 16:45:13 +0000 (18:45 +0200)
- added check for parameter "baseUrl" (null and empty)

src/java/org/mxchange/addressbook/enterprise/BaseAddressbookEnterpriseBean.java
src/java/org/mxchange/jusercore/model/user/AddressbookAdminUserSessionBean.java
src/java/org/mxchange/jusercore/model/user/email_address/AddressbookUserEmailChangeSessionBean.java
src/java/org/mxchange/juserlogincore/model/user/register/AddressbookUserRegistrationSessionBean.java
src/java/org/mxchange/juserlogincore/model/user/resendlink/AddressbookResendLinkSessionBean.java

index 361b58b51433bdc6e9e7b261e502c247f3c43cc2..57d7c9e19cac0cffcf96b6e5eb7bdbf2182f2523 100644 (file)
@@ -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
index 514aae954f1ba3c4b37b6b6385d44cadf4a7e7ba..72207800d79ae144f8cb8474b6326fc3fcf9a795 100644 (file)
@@ -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
index f80cc89bc8a7f201355f7899436ea7adf44d4e36..21d68bb39a2bf7dc406a9faad24a2954cf3ab3ef 100644 (file)
@@ -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
index 563c0156c86b80ead34bcf95db5de5304931a43b..4d5ad00c5e5cbc09a0347db128a3a70b3ea1a0c1 100644 (file)
@@ -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
index 748d340921f34f694663328c383e4d0e53a16650..256d03e3720eaad462ad0811eceea49fddf54a81 100644 (file)
@@ -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