diff options
| author | jackpoz <giacomopoz@gmail.com> | 2015-08-12 12:43:59 +0200 |
|---|---|---|
| committer | Carbenium <carbenium@outlook.com> | 2015-09-24 20:39:42 +0200 |
| commit | 6193b8a28d88428acc46dc591353614ef1f3e160 (patch) | |
| tree | 0792d1bdda5403b8fc1ef050de10b42e8a9e933b /src/server/scripts/Northrend | |
| parent | c3c7ab6ec765833e98799956a44ee9e59bf0af87 (diff) | |
Scripts/Misc: Fix possible crash
Fix possible NULL-dereference exception happening in PlayerOrPet checks used in Ulduar and Temple Of Ahn Qiraj
(cherry picked from commit 5f0f152345ec7e9cc6195ba8f59f316a1cad90f7)
Diffstat (limited to 'src/server/scripts/Northrend')
| -rw-r--r-- | src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h index 2d10ffc01bc..9f640c410ef 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h @@ -425,11 +425,13 @@ class PlayerOrPetCheck public: bool operator()(WorldObject* object) const { - if (object->GetTypeId() != TYPEID_PLAYER) - if (!object->ToCreature()->IsPet()) - return true; + if (object->GetTypeId() == TYPEID_PLAYER) + return false; - return false; + if (Creature* creature = object->ToCreature()) + return !creature->IsPet(); + + return true; } }; |
