mirror of https://github.com/apache/cloudstack.git
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:
parent
28dd8185dd
commit
91a87f9d8f
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue