aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2017-11-27 15:30:31 +0100
committerThomas Lenz <tlenz@iaik.tugraz.at>2017-11-27 15:30:31 +0100
commit813e08137530dba321db7807bd1bb5a53af80541 (patch)
tree567a1811e570214f56a31d0e9aff7c70f29d54c5 /id/server/idserverlib
parentee06b644dbedbe4869de6b926339581a5eefb430 (diff)
downloadmoa-id-spss-813e08137530dba321db7807bd1bb5a53af80541.tar.gz
moa-id-spss-813e08137530dba321db7807bd1bb5a53af80541.tar.bz2
moa-id-spss-813e08137530dba321db7807bd1bb5a53af80541.zip
fix nullpointer in MandateNaturalPersonBPKAttributeBuilder.java
Diffstat (limited to 'id/server/idserverlib')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonBPKAttributeBuilder.java20
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);