Преглед на файлове

SEC-404: NPE when logging out if user not already logged in.

Ben Alex преди 18 години
родител
ревизия
3f62a5c868
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      core/src/main/java/org/acegisecurity/ui/rememberme/TokenBasedRememberMeServices.java

+ 1 - 1
core/src/main/java/org/acegisecurity/ui/rememberme/TokenBasedRememberMeServices.java

@@ -292,7 +292,7 @@ public class TokenBasedRememberMeServices implements RememberMeServices, Initial
     }
 
     public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) {
-        cancelCookie(request, response, "Logout of user " + authentication.getName());
+        cancelCookie(request, response, "Logout of user " + authentication == null ? "Unknown" : authentication.getName()); 
     }
 
     protected Cookie makeCancelCookie(HttpServletRequest request) {