Range check in toDOM()
authorcantor <cantor@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Sat, 25 Jan 2003 22:09:07 +0000 (22:09 +0000)
committercantor <cantor@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Sat, 25 Jan 2003 22:09:07 +0000 (22:09 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@425 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/eduPerson/ScopedAttribute.java

index 1830d6d..d115f9d 100755 (executable)
@@ -199,7 +199,7 @@ public class ScopedAttribute extends SAMLAttribute implements Cloneable
             if (n.getNodeType()==Node.ELEMENT_NODE)
             {
                 ((Element)n).removeAttributeNS(null,"Scope");
-                if (scopes.get(i)!=null && !scopes.get(i).equals(defaultScope))
+                if (i < scopes.size() && scopes.get(i)!=null && !scopes.get(i).equals(defaultScope))
                     ((Element)n).setAttributeNS(null,"Scope",(String)scopes.get(i));
             }
             n=n.getNextSibling();