fix minor bug that could occur if two null subjects were given by two different login...
authorlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 3 Mar 2009 08:41:49 +0000 (08:41 +0000)
committerlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 3 Mar 2009 08:41:49 +0000 (08:41 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/branches/REL_2@2840 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/main/java/edu/internet2/middleware/shibboleth/idp/authn/AuthenticationEngine.java

index beaedae..7ba1c30 100644 (file)
@@ -703,6 +703,10 @@ public class AuthenticationEngine extends HttpServlet {
      * @return subject containing the merged information
      */
     protected Subject mergeSubjects(Subject subject1, Subject subject2) {
+        if (subject1 == null && subject2 == null) {
+            return new Subject();
+        }
+        
         if (subject1 == null) {
             return subject2;
         }
@@ -711,10 +715,6 @@ public class AuthenticationEngine extends HttpServlet {
             return subject1;
         }
 
-        if (subject1 == null && subject2 == null) {
-            return new Subject();
-        }
-
         Set<Principal> principals = new HashSet<Principal>(3);
         principals.addAll(subject1.getPrincipals());
         principals.addAll(subject2.getPrincipals());