diff options
| author | jackpoz <giacomopoz@gmail.com> | 2014-04-20 00:38:25 +0200 |
|---|---|---|
| committer | jackpoz <giacomopoz@gmail.com> | 2014-04-20 00:38:25 +0200 |
| commit | fb6365ac689419a2e5dd758d4bf70c1a20ff41ff (patch) | |
| tree | 2fe3bd97242f12395e9a471b753947f037998cf0 /src/server/scripts/Outland/TempestKeep | |
| parent | 8ca63717932ae6db48d74e866e8d379c4f5a5920 (diff) | |
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().
Diffstat (limited to 'src/server/scripts/Outland/TempestKeep')
| -rw-r--r-- | src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp index 500bcd1ed8f..78a7d71732a 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp @@ -93,7 +93,7 @@ class npc_warp_splinter_treant : public CreatureScript void UpdateAI(uint32 diff) OVERRIDE { - if (!UpdateVictim()) + if (!UpdateVictim() || !me->GetVictim()) { if (WarpGuid && check_Timer <= diff) { @@ -115,7 +115,7 @@ class npc_warp_splinter_treant : public CreatureScript return; } - if (me->EnsureVictim()->GetGUID() != WarpGuid) + if (me->EnsureVictim()->GetGUID() != WarpGuid) DoMeleeAttackIfReady(); } }; |
