factionTemplate->faction can be 0, add appropriate checks to prevent crashes and unexpected work. Author: VladimirMangos

--HG--
branch : trunk
This commit is contained in:
megamage
2009-03-03 16:18:22 -06:00
parent 0a78760b75
commit c113bf884f
4 changed files with 73 additions and 44 deletions

View File

@@ -86,7 +86,7 @@ ObjectAccessor::GetNPCIfCanInteractWith(Player const &player, uint64 guid, uint3
if(factionTemplate)
{
FactionEntry const* faction = sFactionStore.LookupEntry(factionTemplate->faction);
if( faction->reputationListID >= 0 && player.GetReputationRank(faction) <= REP_UNFRIENDLY)
if( faction && faction->reputationListID >= 0 && player.GetReputationRank(faction) <= REP_UNFRIENDLY)
return NULL;
}