mirror of
https://github.com/apache/struts.git
synced 2026-08-31 11:24:28 +00:00
WW-1351
- checked for possible NPE being thrown git-svn-id: https://svn.apache.org/repos/asf/struts/action2/trunk@416987 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
+6
-4
@@ -38,10 +38,12 @@ public class ChatSessionListener implements HttpSessionListener {
|
||||
WebApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(session.getServletContext());
|
||||
if (context != null) {
|
||||
User user = (User) session.getAttribute(ChatInterceptor.CHAT_USER_SESSION_KEY);
|
||||
ChatService service = (ChatService) context.getBean("chatService");
|
||||
service.logout(user.getName());
|
||||
|
||||
_log.info("session expired, logged user ["+user.getName()+"] out");
|
||||
if (user != null) {
|
||||
ChatService service = (ChatService) context.getBean("chatService");
|
||||
service.logout(user.getName());
|
||||
|
||||
_log.info("session expired, logged user ["+user.getName()+"] out");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user