]> git.mxchange.org Git - pizzaservice-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:40 +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/PizzaAdminCountrySingletonBean.java

index 5cb2192c4acfd453642f51f07dbe6348f7fc9ca3..2e05e149038e5dfd068ac58b00b08618648d382e 100644 (file)
@@ -60,9 +60,15 @@ public class PizzaAdminCountrySingletonBean extends BasePizzaEnterpriseBean impl
                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