Added null check for when an AttributeValue element does not have any attributes...
authorlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Fri, 20 Jan 2006 12:49:43 +0000 (12:49 +0000)
committerlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Fri, 20 Jan 2006 12:49:43 +0000 (12:49 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@1918 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/metadata/provider/XMLMetadataProvider.java

index 1099300..c683c90 100644 (file)
@@ -877,8 +877,10 @@ public class XMLMetadataProvider implements Metadata, PluggableConfigurationComp
                     while (src != null) {
                         Element val=e.getOwnerDocument().createElementNS(XML.SAML_NS,"AttributeValue");
                         NamedNodeMap attrs = src.getAttributes();
-                        for (int j=0; j<attrs.getLength(); j++)
-                            val.setAttributeNodeNS((Attr)(e.getOwnerDocument().importNode(attrs.item(j),true)));
+                        if(attrs != null) {
+                            for (int j=0; j<attrs.getLength(); j++)
+                                val.setAttributeNodeNS((Attr)(e.getOwnerDocument().importNode(attrs.item(j),true)));
+                        }
                         while (src.hasChildNodes())
                             val.appendChild(src.getFirstChild());
                         copy.appendChild(val);