Checked for null format in wrong place
[java-idp.git] / src / edu / internet2 / middleware / shibboleth / idp / profile / saml2 / AbstractSAML2ProfileHandler.java
index c820f02..bfdcfdc 100644 (file)
@@ -641,7 +641,7 @@ public abstract class AbstractSAML2ProfileHandler extends AbstractSAMLProfileHan
         String nameFormat = null;
         if (requestContext.getSamlRequest() instanceof AuthnRequest) {
             AuthnRequest authnRequest = (AuthnRequest) requestContext.getSamlRequest();
-            if (authnRequest.getNameIDPolicy() != null) {
+            if (authnRequest.getNameIDPolicy() != null && !DatatypeHelper.isEmpty(nameFormat)) {
                 nameFormat = authnRequest.getNameIDPolicy().getFormat();
                 if (assertingPartySupportedFormats.contains(nameFormat)) {
                     nameFormats.add(nameFormat);