Be sure not to add null values to list
authorlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Sat, 15 Mar 2008 09:02:36 +0000 (09:02 +0000)
committerlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Sat, 15 Mar 2008 09:02:36 +0000 (09:02 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@2698 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/idp/authn/Saml2LoginContext.java

index 645ac95..7173e98 100644 (file)
@@ -36,6 +36,7 @@ import org.opensaml.xml.io.Marshaller;
 import org.opensaml.xml.io.MarshallingException;
 import org.opensaml.xml.io.Unmarshaller;
 import org.opensaml.xml.io.UnmarshallingException;
+import org.opensaml.xml.util.DatatypeHelper;
 import org.opensaml.xml.util.XMLHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -191,7 +192,7 @@ public class Saml2LoginContext extends LoginContext implements Serializable {
         List<AuthnContextClassRef> authnClasses = authnContext.getAuthnContextClassRefs();
         if (authnClasses != null) {
             for (AuthnContextClassRef classRef : authnClasses) {
-                if (classRef != null) {
+                if (classRef != null && !DatatypeHelper.isEmpty(classRef.getAuthnContextClassRef())) {
                     requestedMethods.add(classRef.getAuthnContextClassRef());
                 }
             }
@@ -200,7 +201,7 @@ public class Saml2LoginContext extends LoginContext implements Serializable {
         List<AuthnContextDeclRef> authnDeclRefs = authnContext.getAuthnContextDeclRefs();
         if (authnDeclRefs != null) {
             for (AuthnContextDeclRef declRef : authnDeclRefs) {
-                if (declRef != null) {
+                if (declRef != null&& !DatatypeHelper.isEmpty(declRef.getAuthnContextDeclRef())) {
                     requestedMethods.add(declRef.getAuthnContextDeclRef());
                 }
             }