Core/Misc: Check GetVictim() for NULL before dereferencing it

Add additional NULL checks all around the code before dereferencing GetVictim() result.
Keep in mind UpdateVictim() result has nothing to do with GetVictim() result and the caller shouldn't assume anything about GetVictim() based on UpdateVictim().
This commit is contained in:
jackpoz committed 2014-04-20 00:38:25 +02:00
1 parent 8ca6371793
commit fb6365ac68
17 files changed
+37 -24

No files matched your search

+1 -1
View File
@@ -93,7 +93,7 @@ class npc_pet_hunter_snake_trap : public CreatureScript
void UpdateAI(uint32 diff) OVERRIDE
{
if (!UpdateVictim())
if (!UpdateVictim() || !me->GetVictim())
return;
if (me->EnsureVictim()->HasBreakableByDamageCrowdControlAura(me))