From 9a8f7a81b57fd31616fe62cef21800b8cfb862c6 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Wed, 18 Jun 2014 10:31:04 +0200 Subject: fixed NullPointerEx on STORK2 AttrQueryRequest --- .../moa/id/protocols/stork2/AuthenticationRequest.java | 2 +- .../egovernment/moa/id/protocols/stork2/MOASTORKRequest.java | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'id') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AuthenticationRequest.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AuthenticationRequest.java index 9a40e0b72..8e66db384 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AuthenticationRequest.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AuthenticationRequest.java @@ -75,7 +75,7 @@ public class AuthenticationRequest implements IAction { this.authData = authData; - if ((req instanceof MOASTORKRequest) && ((MOASTORKRequest) req).getStorkAuthnRequest().getCitizenCountryCode().equals("AT")) { + if ((req instanceof MOASTORKRequest) && ((MOASTORKRequest) req).getCitizenCountryCode().equals("AT")) { this.moaStorkRequest = (MOASTORKRequest) req; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOASTORKRequest.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOASTORKRequest.java index 0f160eed6..076139018 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOASTORKRequest.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOASTORKRequest.java @@ -193,6 +193,18 @@ public class MOASTORKRequest extends RequestImpl { return this.storkAuthnRequest.getAssertionConsumerServiceURL(); } + /** + * Gets the citizen country code. + * + * @return the citizen country code + */ + public String getCitizenCountryCode() { + if(isAttrRequest()) + return this.storkAttrQueryRequest.getCitizenCountryCode(); + else + return this.storkAuthnRequest.getCitizenCountryCode(); + } + /* (non-Javadoc) * @see at.gv.egovernment.moa.id.moduls.IRequest#getRequestedIDP() */ -- cgit v1.2.3