diff options
author | jackpoz <giacomopoz@gmail.com> | 2014-04-25 11:35:32 +0200 |
---|---|---|
committer | jackpoz <giacomopoz@gmail.com> | 2014-04-25 11:35:32 +0200 |
commit | eb711fd9e95498de138e6558daeaeed9f1a0abb4 (patch) | |
tree | 13171f80954dd552990a87262bcd870561177e0d /src | |
parent | 0dbc8d4f48c1bdf6812d1112c971d611c870981f (diff) |
Core/LFG: Fix crash
Fix crash added in ab1d0512ea7818d64a63a514195dbd9644d284fb by adding an additional NULL check.
Fixes #11941
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/DungeonFinding/LFGMgr.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 264efb49ab3..d353efb58c7 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -1541,12 +1541,17 @@ LfgDungeonSet const& LFGMgr::GetSelectedDungeons(uint64 guid) LfgLockMap const LFGMgr::GetLockedDungeons(uint64 guid) { TC_LOG_TRACE("lfg.data.player.dungeons.locked.get", "Player: %u, LockedDungeons.", GUID_LOPART(guid)); + LfgLockMap lock; Player* player = ObjectAccessor::FindPlayer(guid); + if (!player) + { + TC_LOG_WARN("lfg.data.player.dungeons.locked.get", "Player: %u not ingame while retrieving his LockedDungeons.", GUID_LOPART(guid)); + return lock; + } uint8 level = player->getLevel(); uint8 expansion = player->GetSession()->Expansion(); LfgDungeonSet const& dungeons = GetDungeonsByRandom(0); - LfgLockMap lock; bool denyJoin = !player->GetSession()->HasPermission(rbac::RBAC_PERM_JOIN_DUNGEON_FINDER); for (LfgDungeonSet::const_iterator it = dungeons.begin(); it != dungeons.end(); ++it) |