mirror of https://github.com/apache/cloudstack.git
bug 6818: if the userAccount is null, the user is either removed or does not exist. Since we can't log them out in those cases, just skip saving the logout event (and hence avoid the NPE).
status 6818: resolved fixed
This commit is contained in:
parent
e2f725308d
commit
640a3dc239
|
|
@ -4535,7 +4535,9 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
@Override
|
||||
public void logoutUser(Long userId) {
|
||||
UserAccount userAcct = _userAccountDao.findById(userId);
|
||||
EventUtils.saveEvent(userId, userAcct.getAccountId(), EventTypes.EVENT_USER_LOGOUT, "user has logged out");
|
||||
if (userAcct != null) {
|
||||
EventUtils.saveEvent(userId, userAcct.getAccountId(), EventTypes.EVENT_USER_LOGOUT, "user has logged out");
|
||||
} // else log some kind of error event? This likely means the user doesn't exist, or has been deleted...
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in New Issue