aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2020-07-09 22:12:18 +0200
committerShauren <shauren.trinity@gmail.com>2022-01-22 00:50:40 +0100
commitff778a7581b47458d257e867931de0f3b46589e4 (patch)
treef4992ee4ae6fc6f1fdc989eb0a92043134340e3e
parent120c9f3f74ec3408091c9d3a742fa6a09af931f9 (diff)
Core/Creature: Add null check for charmed creatures
(cherry picked from commit b4adaa838c2e44f4008152cc955410d25ff4d8b0)
-rw-r--r--src/server/game/Entities/Creature/Creature.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index bf364fca4c6..ae57f430667 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -3070,7 +3070,7 @@ std::string Creature::GetNameForLocaleIdx(LocaleConstant locale) const
uint32 Creature::GetPetAutoSpellOnPos(uint8 pos) const
{
- if (pos >= MAX_SPELL_CHARM || m_charmInfo->GetCharmSpell(pos)->GetType() != ACT_ENABLED)
+ if (pos >= MAX_SPELL_CHARM || !m_charmInfo || m_charmInfo->GetCharmSpell(pos)->GetType() != ACT_ENABLED)
return 0;
else
return m_charmInfo->GetCharmSpell(pos)->GetAction();