From d276b216e1c24c6e4fee70db42a20d4b41842e69 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 25 Jun 2022 14:57:38 +0200 Subject: [PATCH] Please cherry-pick: - country.countryCode and countryI18nKey could be NULL here (independently from each other) and needs checking BEFORE any method on them is being executed MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../model/data/FinancialsAdminCountrySingletonBean.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/java/org/mxchange/jcountry/model/data/FinancialsAdminCountrySingletonBean.java b/src/java/org/mxchange/jcountry/model/data/FinancialsAdminCountrySingletonBean.java index 766d655..8e7b4dd 100644 --- a/src/java/org/mxchange/jcountry/model/data/FinancialsAdminCountrySingletonBean.java +++ b/src/java/org/mxchange/jcountry/model/data/FinancialsAdminCountrySingletonBean.java @@ -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 -- 2.39.5