]> git.mxchange.org Git - pizzaservice-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:05 +0000 (18:45 +0200)
- added check for parameter "baseUrl" (null and empty)

src/java/org/mxchange/jusercore/model/user/PizzaAdminUserSessionBean.java
src/java/org/mxchange/jusercore/model/user/email_address/PizzaUserEmailChangeSessionBean.java
src/java/org/mxchange/juserlogincore/model/user/register/PizzaUserRegistrationSessionBean.java
src/java/org/mxchange/juserlogincore/model/user/resendlink/PizzaResendLinkSessionBean.java
src/java/org/mxchange/pizzaapplication/enterprise/BasePizzaEnterpriseBean.java

index 5670b50070c28730621e7d5f0cf23aa9d0912cc0..5fe06a9582e1ed137c140105bd6e1457315b0648 100644 (file)
@@ -239,6 +239,12 @@ public class PizzaAdminUserSessionBean extends BasePizzaEnterpriseBean implement
                } 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
@@ -300,6 +306,12 @@ public class PizzaAdminUserSessionBean extends BasePizzaEnterpriseBean implement
                } 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 36149838859e8e82ef8c7c087c909ae73b092e06..d3099afd41b322813f738f772096d28600bade21 100644 (file)
@@ -81,6 +81,12 @@ public class PizzaUserEmailChangeSessionBean extends BasePizzaEnterpriseBean imp
                } 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 47766e13b4a9294c9f84f7b6f4b3ff96f8991f92..79ae7c51ecf117a7d04852a34017bdcf7cfb0815 100644 (file)
@@ -120,6 +120,12 @@ public class PizzaUserRegistrationSessionBean extends BasePizzaEnterpriseBean im
                } 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 b189ba7995f3aa70d937adce3ae4ae8c2a3c0fa2..3e374fb98c3911da44b5d51705248aad035e54db 100644 (file)
@@ -93,6 +93,12 @@ public class PizzaResendLinkSessionBean extends BasePizzaEnterpriseBean implemen
                } 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
index 022609ebc80e8ef03c1c6cdd90fe47304511036e..7e56c9db7e29fd2ed5ee19130d90e16c87e48af5 100644 (file)
@@ -1489,6 +1489,12 @@ public abstract class BasePizzaEnterpriseBean 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