]> git.mxchange.org Git - jfinancials-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 12:58:34 +0000 (14:58 +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/FinancialsAdminCountrySingletonBean.java

index 766d6556adbdafdb171368de4032022e0a0db5ce..8e7b4dd5140f2cc38eb615085fbe6ec7acdc1881 100644 (file)
@@ -60,9 +60,15 @@ public class FinancialsAdminCountrySingletonBean extends BaseFinancialsEnterpris
                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