From eb711fd9e95498de138e6558daeaeed9f1a0abb4 Mon Sep 17 00:00:00 2001 From: jackpoz Date: Fri, 25 Apr 2014 11:35:32 +0200 Subject: Core/LFG: Fix crash Fix crash added in ab1d0512ea7818d64a63a514195dbd9644d284fb by adding an additional NULL check. Fixes #11941 --- src/server/game/DungeonFinding/LFGMgr.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/server') 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) -- cgit v1.2.3