void userclient_close(struct UserClient *client) {
if(client->flags & USERCLIENT_LOGGED_IN) {
- usersession_client_close(client->user);
+ if(client->user)
+ usersession_client_close(client->user);
} else {
struct UserLogin *login = client->user;
if(client->flags & USERCLIENT_LOGIN_PROCESSING) {