Create parser pool interface and move current pool to an implementation of this inter...
[java-idp.git] / src / edu / internet2 / middleware / shibboleth / utils / KerberosPrincipalFilter.java
index 6fbf224..20e64df 100644 (file)
@@ -63,10 +63,15 @@ public class KerberosPrincipalFilter implements Filter {
                HttpServletRequest httpRequest = (HttpServletRequest) request;
 
                String name = httpRequest.getRemoteUser();
-               int split = name.indexOf('@');
-               if (split > -1) name = name.substring(0, split);
-
-               chain.doFilter(new KerberosPrincipalWrapper(httpRequest, new PrincipalImpl(name)), response);
+               if (name != null) {
+                       int split = name.indexOf('@');
+                       if (split > -1) {
+                               name = name.substring(0, split);
+                               chain.doFilter(new KerberosPrincipalWrapper(httpRequest, new PrincipalImpl(name)), response);
+                               return;
+                       }
+               }
+               chain.doFilter(request, response);
        }
 
        /**