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

src/java/org/mxchange/jjobs/enterprise/BaseJobsEnterpriseBean.java
src/java/org/mxchange/jusercore/model/user/JobsAdminUserSessionBean.java
src/java/org/mxchange/jusercore/model/user/email_address/JobsUserEmailChangeSessionBean.java
src/java/org/mxchange/juserlogincore/model/user/register/JobsUserRegistrationSessionBean.java
src/java/org/mxchange/juserlogincore/model/user/resendlink/JobsResendLinkSessionBean.java

index e0198c9537b2c978032f99e1a45b41fc0e526033..8926e6b3e987fc607cc405537ca8236215c084c3 100644 (file)
@@ -1217,6 +1217,12 @@ public abstract class BaseJobsEnterpriseBean 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 6b92574db89b04e538fea39709ef41a051896c7b..34fc60103db80876f4f010890d5263fd1d33ad37 100644 (file)
@@ -238,6 +238,12 @@ public class JobsAdminUserSessionBean extends BaseJobsEnterpriseBean implements
                } 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 JobsAdminUserSessionBean extends BaseJobsEnterpriseBean implements
                } 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 b5c34ebc38ad32ec5bbaff1032b6cbd3c8e8db79..0787a625525260cf5d9bb1eeffcad302ba200b74 100644 (file)
@@ -81,6 +81,12 @@ public class JobsUserEmailChangeSessionBean extends BaseJobsEnterpriseBean imple
                } 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 3b88ddaea630bcaef4427166bca27878009f1b14..b99ddf8395d33b494f4754ccd46ebf93fc2fdc45 100644 (file)
@@ -120,6 +120,12 @@ public class JobsUserRegistrationSessionBean extends BaseJobsEnterpriseBean impl
                } 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 4e18f635d9fb48edd1826426fbea220c621738b1..7399af6fc2731649706d1852504b4590320dee7c 100644 (file)
@@ -93,6 +93,12 @@ public class JobsResendLinkSessionBean extends BaseJobsEnterpriseBean implements
                } 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