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:
1 parent
8ca6371793
commit
fb6365ac68
17 files changed
+37
-24
No files matched your search
@@ -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))
|
||||
|
||||
Reference in new issue
Block a user