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

src/java/org/mxchange/jfinancials/enterprise/BaseFinancialsEnterpriseBean.java
src/java/org/mxchange/jusercore/model/user/FinancialsAdminUserSessionBean.java
src/java/org/mxchange/jusercore/model/user/email_address/FinancialsUserEmailChangeSessionBean.java
src/java/org/mxchange/juserlogincore/model/user/register/FinancialsUserRegistrationSessionBean.java
src/java/org/mxchange/juserlogincore/model/user/resendlink/FinancialsResendLinkSessionBean.java

index a0cd964e671ef750c8706735f052f20a36d3797f..8485903db3ae6280a66b567eba018a9373c96960 100644 (file)
@@ -1184,6 +1184,12 @@ public abstract class BaseFinancialsEnterpriseBean 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 1e1a02332ec9f7cc0be7dce6763f6e1a501d4459..7e3895e985523f5117ba8926d379882c4289c2ea 100644 (file)
@@ -238,6 +238,12 @@ public class FinancialsAdminUserSessionBean extends BaseFinancialsEnterpriseBean
                } 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 FinancialsAdminUserSessionBean extends BaseFinancialsEnterpriseBean
                } 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 0e583ebb6f56373d914e553b12c3bdf4803d78d6..2114aa57a2f308fd9f577aaea4a6aa9a702bca37 100644 (file)
@@ -81,6 +81,12 @@ public class FinancialsUserEmailChangeSessionBean extends BaseFinancialsEnterpri
                } 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 17b9524aa699a62aac3f83ebc8e70a8676139b19..1c2a6687ceae12d7e958d67e74fc66861a395407 100644 (file)
@@ -120,6 +120,12 @@ public class FinancialsUserRegistrationSessionBean extends BaseFinancialsEnterpr
                } 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 831ece491cbf577de246184ab075d26296090d8e..fb03931b040c2bf0eb1c007e7181538d5b273ec9 100644 (file)
@@ -93,6 +93,12 @@ public class FinancialsResendLinkSessionBean extends BaseFinancialsEnterpriseBea
                } 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