From addd90ec1f988bcae99890d1008175c12a98068c Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Thu, 20 Feb 2014 17:02:13 +0100 Subject: BugFix: STORK -> MOA-ID-AUTH NullPointerException if no STORK configuration exist --- .../moa/id/config/stork/STORKConfig.java | 23 ++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'id') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/stork/STORKConfig.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/stork/STORKConfig.java index 463930fd7..ff481b825 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/stork/STORKConfig.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/stork/STORKConfig.java @@ -63,23 +63,26 @@ public class STORKConfig { cpepsMap = new HashMap(); - for(at.gv.egovernment.moa.id.commons.db.dao.config.CPEPS cpep : cpeps) { + if (cpeps != null) { + for(at.gv.egovernment.moa.id.commons.db.dao.config.CPEPS cpep : cpeps) { - try { - CPEPS moacpep = new CPEPS(cpep.getCountryCode(), new URL(cpep.getURL())); + try { + CPEPS moacpep = new CPEPS(cpep.getCountryCode(), new URL(cpep.getURL())); - cpepsMap.put(cpep.getCountryCode(), moacpep); + cpepsMap.put(cpep.getCountryCode(), moacpep); - } catch (MalformedURLException e) { - Logger.warn("Error in MOA-ID Configuration. CPEP entry for country " - + cpep.getCountryCode() + " has an invalid URL and is ignored."); + } catch (MalformedURLException e) { + Logger.warn("Error in MOA-ID Configuration. CPEP entry for country " + + cpep.getCountryCode() + " has an invalid URL and is ignored."); + } } } - attr = new ArrayList(); - for(StorkAttribute current : stork.getAttributes()) { - attr.add(current); + if (stork.getAttributes() != null) { + for(StorkAttribute current : stork.getAttributes()) { + attr.add(current); + } } } -- cgit v1.2.3