package infodoc.ui.auth;

import infodoc.core.ui.auth.AuthService;

import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

import org.slf4j.LoggerFactory;

import enterpriseapp.hibernate.dto.User;


public class SessionListener implements HttpSessionListener {

	/**
     * @see HttpSessionListener#sessionCreated(HttpSessionEvent)
     */
    public void sessionCreated(HttpSessionEvent event) {
    }

	/**
     * @see HttpSessionListener#sessionDestroyed(HttpSessionEvent)
     */
    public void sessionDestroyed(HttpSessionEvent event) {
    	User user = (User) event.getSession().getAttribute("user");
    	AuthService.getLoggedUserApps().get(user);
    	LoggerFactory.getLogger(SessionListener.class).debug("Session destroyed (user id = " + user == null ? "null" : user.getId() + ")");
    }
	
}

@@ -25,52 +25,8 @@
 %0D%0A%0D%0A
-import infodoc.core.ui.auth.AuthService;%0D%0A%0D%0A
 impo
@@ -120,87 +120,8 @@
 %0D%0A%0D%0A
-import org.slf4j.LoggerFactory;%0D%0A%0D%0Aimport enterpriseapp.hibernate.dto.User;%0D%0A%0D%0A
 %0D%0Apu
@@ -181,16 +181,17 @@
 ener %7B%0D%0A
+%09
 %0D%0A%09/**%0D%0A
@@ -479,261 +479,8 @@
  %7B%0D%0A
-    %09User user = (User) event.getSession().getAttribute(%22user%22);%0D%0A    %09AuthService.getLoggedUserApps().get(user);%0D%0A    %09LoggerFactory.getLogger(SessionListener.class).debug(%22Session destroyed (user id = %22 + user == null ? %22null%22 : user.getId() + %22)%22);%0D%0A
     

Fix NullPointerException in SessionListener.