diff --git a/src/net/common/servergame.cpp b/src/net/common/servergame.cpp index dfa3dc73..63028e9d 100644 --- a/src/net/common/servergame.cpp +++ b/src/net/common/servergame.cpp @@ -455,12 +455,17 @@ ServerGame::StoreLastGames() RankingMap::const_iterator i = m_rankingMap.begin(); RankingMap::const_iterator end = m_rankingMap.end(); while (i != end) { - std::vector lastGames = GetSessionManager().GetSessionByUniquePlayerId((*i).second.dbid).GetPlayerLastGames(); - if(lastGames) - //GetLobbyThread().GetDatabase().SetGamePlayerPlace(GetId(), (*i).second.dbid, lastGames); - LOG_VERBOSE("first timeStamp" << lastGames.front().first << "."); - + boost::shared_ptr tmpSession = GetSessionManager().GetSessionByUniquePlayerId((*i).second.dbid); + + + if(tmpSession){ + std::vector lastGames = tmpSession->GetPlayerLastGames(); + + if(lastGames) + //GetLobbyThread().GetDatabase().SetGamePlayerPlace(GetId(), (*i).second.dbid, lastGames); + LOG_VERBOSE("first timeStamp" << lastGames.front().first << "."); + } ++i; } GetDatabase().EndGame(GetId());