From 80c20b4784389b4cda18c731f2817ed545745aca Mon Sep 17 00:00:00 2001 From: Elmsroth Date: Tue, 28 Jul 2020 23:17:24 +0200 Subject: [PATCH] Fix potential NullPointerException on C'Thun (#107) Reported from a crash on C'Thun it appeared there was a NPE in Creature.cpp --- src/game/Object/Creature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/Object/Creature.cpp b/src/game/Object/Creature.cpp index b3b45be9..c54c8bc0 100644 --- a/src/game/Object/Creature.cpp +++ b/src/game/Object/Creature.cpp @@ -2546,7 +2546,7 @@ bool Creature::MeetsSelectAttackingRequirement(Unit* pTarget, SpellEntry const* return false; } - if (selectFlags & SELECT_FLAG_IN_LOS && !DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, pSpellInfo->Id, pTarget, SPELL_DISABLE_LOS) && !IsWithinLOSInMap(pTarget)) + if (pSpellInfo && selectFlags & SELECT_FLAG_IN_LOS && !DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, pSpellInfo->Id, pTarget, SPELL_DISABLE_LOS) && !IsWithinLOSInMap(pTarget)) { return false; }