- list<Player*>::iterator iter;
- unsigned long hv = iHASH((unsigned char *) user->stats->getName().c_str());
- iter = find(players[hv].begin(), players[hv].end(), user->stats);
-
- if (iter == players[hv].end())
- {
- notice(s_GameServ, user->getNick(), "Fatal error. Contact "\
- "%S Admin. Cannot find you in the players list. This should NEVER happen");
- log("Error on logout(). Can't find %s in the players list",
+ if (user->stats != NULL)
+ {
+
+ list<Player*>::iterator iter;
+ unsigned long hv = iHASH((unsigned char *) user->stats->getName().c_str());
+ iter = find(players[hv].begin(), players[hv].end(), user->stats);
+
+ if (iter == players[hv].end())
+ {
+ notice(s_GameServ, user->getNick(), "Fatal error. Contact "\
+ "%S Admin. Cannot find you in the players list. This should NEVER happen");
+ log("Error on logout(). Can't find %s in the players list",