diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2016-03-24 12:22:25 +0100 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2016-03-24 12:22:25 +0100 |
commit | d8afdada80249cc2d944b120343fdc22c22ba707 (patch) | |
tree | cf8f26145d93907c32295251ac6d925e669802de /id/ConfigWebTool/src/main/java | |
parent | 859d7b200e1efa6caa1c72e32f22e61660b1b2ef (diff) | |
download | moa-id-spss-d8afdada80249cc2d944b120343fdc22c22ba707.tar.gz moa-id-spss-d8afdada80249cc2d944b120343fdc22c22ba707.tar.bz2 moa-id-spss-d8afdada80249cc2d944b120343fdc22c22ba707.zip |
fix possible NullPointer in STORK configuration
Diffstat (limited to 'id/ConfigWebTool/src/main/java')
-rw-r--r-- | id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java index 3fad65fe5..33277af07 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java @@ -237,16 +237,27 @@ public class OASTORKConfig implements IOnlineApplicationData{ return result; for(AttributeHelper current : getHelperAttributes()) { - for(StorkAttribute currentAttribute : dbconfig.getAuthComponentGeneral().getForeignIdentities().getSTORK().getAttributes()) - if(currentAttribute.getName().equals(current.getName())) { - if(current.isUsed() || currentAttribute.isMandatory()) { - OAStorkAttribute tmp = new OAStorkAttribute(); - tmp.setName(current.getName()); - tmp.setMandatory(current.isMandatory()); - result.add(tmp); + List<StorkAttribute> generalConfStorkAttr = null; + try { + generalConfStorkAttr = dbconfig.getAuthComponentGeneral().getForeignIdentities().getSTORK().getAttributes(); + + } catch (NullPointerException e) { + log.trace("No STORK attributes in 'General Configuration'"); + + } + + if (generalConfStorkAttr != null) { + for(StorkAttribute currentAttribute : generalConfStorkAttr) + if(currentAttribute.getName().equals(current.getName())) { + if(current.isUsed() || currentAttribute.isMandatory()) { + OAStorkAttribute tmp = new OAStorkAttribute(); + tmp.setName(current.getName()); + tmp.setMandatory(current.isMandatory()); + result.add(tmp); + } + break; } - break; - } + } } return result; |