Handle nulls correctly.
authornlevitt <nlevitt@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Fri, 16 Apr 2004 21:36:28 +0000 (21:36 +0000)
committernlevitt <nlevitt@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Fri, 16 Apr 2004 21:36:28 +0000 (21:36 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@992 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/aa/arp/provider/ExactSharMatchFunction.java

index a3f89cf..56c5612 100755 (executable)
@@ -68,8 +68,11 @@ public class ExactSharMatchFunction implements MatchFunction {
        public boolean match(Object arpComponent, Object requestComponent)
                throws MatchingException
        {
-               if (!(arpComponent instanceof String) || !(requestComponent instanceof String)) {
-                       log.error("Invalid use of ARP matching function (ExacthSharMatchFunction).");
+               if (arpComponent == null || requestComponent == null) {
+                       return false;
+               }
+               else if (!(arpComponent instanceof String) || !(requestComponent instanceof String)) {
+                       log.error("Invalid use of ARP matching function (ExacthSharMatchFunction). arpComponent: (" + arpComponent + "). requestComponent: (" + requestComponent + ").");
                        throw new MatchingException("Invalid use of ARP matching function (ExacthSharMatchFunction).");
                }
                return arpComponent.equals(requestComponent);