Commit d9c5b66f authored by Sonia Zorba's avatar Sonia Zorba
Browse files

LoggingDAO bugfix

parent fd37936e
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.sql.DataSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
@@ -91,9 +92,11 @@ public class LoggingDAO {
        if (request.getUserPrincipal() != null && request.getUserPrincipal() instanceof RapPrincipal) {
            return request.getUserPrincipal().getName();
        } else if (request.getSession(false) != null) {
            try {
                return sessionData.getUserId();
        } else {
            return null;
            } catch (BeanCreationException ex) {
            }
        }
        return null;
    }
}