More defensive scope handling.
authorcantor <cantor@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Fri, 14 Jun 2002 20:20:39 +0000 (20:20 +0000)
committercantor <cantor@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Fri, 14 Jun 2002 20:20:39 +0000 (20:20 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@124 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

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

index c60f008..ced4da0 100755 (executable)
@@ -144,8 +144,8 @@ public class ScopedAttribute extends SAMLAttribute
         for (int i = 0; i < nlist.getLength(); i++)
         {
             ((Element)nlist.item(i)).removeAttributeNS(null, "Scope");
-            String scope=scopes.get(i).toString();
-            if (scope != null && !scope.equals(defaultScope))
+            String scope=(i<scopes.size() ? scopes.get(i).toString() : null);
+            if (scope != null && scope.length()>0 && !scope.equals(defaultScope))
                 ((Element)nlist.item(i)).setAttributeNS(null, "Scope", scope);
         }