summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2020-12-26 17:23:56 +0100
committerThomas Lenz <thomas.lenz@egiz.gv.at>2020-12-26 17:23:56 +0100
commit5e3d231ee2fc3ebc73f87fcd1be0d7d76e7f67b5 (patch)
treee74abc5edd43c1b85fce1cf726cf6df44f4b5232
parent5f167f8b4fd569a336a48720e5452cb36b94c3ae (diff)
downloadEAAF-Components-5e3d231ee2fc3ebc73f87fcd1be0d7d76e7f67b5.tar.gz
EAAF-Components-5e3d231ee2fc3ebc73f87fcd1be0d7d76e7f67b5.tar.bz2
EAAF-Components-5e3d231ee2fc3ebc73f87fcd1be0d7d76e7f67b5.zip
fix possible NullPointerException in BpkAttributeBuilder
-rw-r--r--eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/builder/attributes/BpkAttributeBuilder.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/builder/attributes/BpkAttributeBuilder.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/builder/attributes/BpkAttributeBuilder.java
index 17919fc2..70e0f6d1 100644
--- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/builder/attributes/BpkAttributeBuilder.java
+++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/builder/attributes/BpkAttributeBuilder.java
@@ -57,12 +57,13 @@ public class BpkAttributeBuilder implements IPvpAttributeBuilder {
}
protected String getBpkForSP(final IAuthData authData) throws UnavailableAttributeException {
- final String bpk = attrMaxSize(authData.getBpk());
- final String type = BpkBuilder.removeBpkTypePrefix(authData.getBpkType());
-
- if (StringUtils.isEmpty(bpk)) {
+ if (StringUtils.isEmpty(authData.getBpk()) || StringUtils.isEmpty(authData.getBpkType())) {
throw new UnavailableAttributeException(BPK_NAME);
+
}
+
+ final String bpk = attrMaxSize(authData.getBpk());
+ final String type = BpkBuilder.removeBpkTypePrefix(authData.getBpkType());
return type + DELIMITER_BPKTYPE_BPK + bpk;