]> git.mxchange.org Git - jjobs-ejb.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Sat, 25 Jun 2022 12:57:38 +0000 (14:57 +0200)
committerRoland Häder <roland@mxchange.org>
Sat, 25 Jun 2022 13:01:44 +0000 (15:01 +0200)
- country.countryCode and countryI18nKey could be NULL here (independently from
  each other) and needs checking BEFORE any method on them is being executed

Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jcountry/model/data/JobsAdminCountrySingletonBean.java

index 2137fa8cc24806070cbcfd2d251d098282cf13e5..c23bb568262460a50b94bce9c8d40d83e7fa309c 100644 (file)
@@ -60,9 +60,15 @@ public class JobsAdminCountrySingletonBean extends BaseJobsEnterpriseBean implem
                if (null == country) {
                        // Throw NPE
                        throw new NullPointerException("country is null"); //NOI18N
+               } else if (country.getCountryCode() == null) {
+                       // Required field not set
+                       throw new NullPointerException("country.countryCode is null"); //NOI18N
                } else if (country.getCountryCode().isEmpty()) {
                        // Code is not set
                        throw new IllegalArgumentException("country.countryCode is empty"); //NOI18N
+               } else if (country.getCountryI18nKey() == null) {
+                       // Required field not set
+                       throw new NullPointerException("country.countryI18nKey is null"); //NOI18N
                } else if (country.getCountryI18nKey().isEmpty()) {
                        // I18n key is not set
                        throw new IllegalArgumentException("country.countryI18nKey is empty"); //NOI18N