diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2017-11-27 15:30:31 +0100 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2017-11-27 15:45:29 +0100 |
commit | 75c7ab602fe14d56217f268ea80e787a5316288a (patch) | |
tree | a6ea86bf2fde0ee7c1eda046764cd2bd38ebd700 | |
parent | 366c463274f3ca06d500c59c0839feb225b4e0b5 (diff) | |
download | moa-id-spss-75c7ab602fe14d56217f268ea80e787a5316288a.tar.gz moa-id-spss-75c7ab602fe14d56217f268ea80e787a5316288a.tar.bz2 moa-id-spss-75c7ab602fe14d56217f268ea80e787a5316288a.zip |
fix nullpointer in MandateNaturalPersonBPKAttributeBuilder.java
-rw-r--r-- | id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonBPKAttributeBuilder.java | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonBPKAttributeBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonBPKAttributeBuilder.java index 6ac517e19..ad469921c 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonBPKAttributeBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonBPKAttributeBuilder.java @@ -57,15 +57,21 @@ public class MandateNaturalPersonBPKAttributeBuilder implements IPVPAttributeBui if (MiscUtil.isEmpty(bpk)) throw new UnavailableAttributeException(BPK_NAME); - - if (type.startsWith(Constants.URN_PREFIX_WBPK)) - type = type.substring((Constants.URN_PREFIX_WBPK + "+").length()); - else if (type.startsWith(Constants.URN_PREFIX_CDID)) - type = type.substring((Constants.URN_PREFIX_CDID + "+").length()); + if (type != null) { + if (type.startsWith(Constants.URN_PREFIX_WBPK)) + type = type.substring((Constants.URN_PREFIX_WBPK + "+").length()); + + else if (type.startsWith(Constants.URN_PREFIX_CDID)) + type = type.substring((Constants.URN_PREFIX_CDID + "+").length()); - else if (type.startsWith(Constants.URN_PREFIX_EIDAS)) - type = type.substring((Constants.URN_PREFIX_EIDAS + "+").length()); + else if (type.startsWith(Constants.URN_PREFIX_EIDAS)) + type = type.substring((Constants.URN_PREFIX_EIDAS + "+").length()); + + } else { + Logger.debug("bPK type is 'null' --> use it as it is"); + + } if (bpk.length() > BPK_MAX_LENGTH) { bpk = bpk.substring(0, BPK_MAX_LENGTH); |