From 01b08361d21a6c0efab965850e0fe2d160cbabcc Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Wed, 16 Sep 2015 19:17:40 +0200 Subject: fix possible NullPointerException in STORK configuration --- .../validation/moaconfig/StorkConfigValidator.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'id/ConfigWebTool') diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/StorkConfigValidator.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/StorkConfigValidator.java index a042a7931..b69d37d57 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/StorkConfigValidator.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/StorkConfigValidator.java @@ -67,14 +67,16 @@ public class StorkConfigValidator { } } - // ensure uniqueness of country code - for (CPEPS one : form.getCpepslist()) - for (CPEPS another : form.getCpepslist()) - if (null != one && null != another) - if (!one.equals(another) && one.getCountryCode().equals(another.getCountryCode())) { - errors.add(LanguageHelper.getErrorString("validation.stork.cpeps.duplicate", request)); - break; - } + if (form.getCpepslist() != null) { + // ensure uniqueness of country code + for (CPEPS one : form.getCpepslist()) + for (CPEPS another : form.getCpepslist()) + if (null != one && null != another) + if (!one.equals(another) && one.getCountryCode().equals(another.getCountryCode())) { + errors.add(LanguageHelper.getErrorString("validation.stork.cpeps.duplicate", request)); + break; + } + } } // check qaa -- cgit v1.2.3