bug 7155: fixed NPE in AuditTrial which used to happen when logout command was executed when session was already invalidated.

status 7155: resolved fixed
This commit is contained in:
alena 2010-11-17 21:42:51 -08:00
parent 28dd8185dd
commit 91a87f9d8f
1 changed files with 5 additions and 1 deletions

View File

@ -97,8 +97,12 @@ public class ApiServlet extends HttpServlet {
if (session != null) {
Long userId = (Long)session.getAttribute("userid");
Account account = (Account)session.getAttribute("accountobj");
Long accountId = null;
if (account != null) {
accountId = account.getId();
}
auditTrailSb.insert(0, "(userId="+userId+
" accountId="+ account==null ? null:account.getId()+
" accountId="+ accountId +
" sessionId="+session.getId() +")" );
if (userId != null) {
_apiServer.logoutUser(userId);