Fix potential NullPointerException on C'Thun (#107)

Reported from a crash on C'Thun it appeared there was a NPE in Creature.cpp
This commit is contained in:
Elmsroth 2020-07-28 23:17:24 +02:00 committed by GitHub
parent 5768071296
commit 80c20b4784
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}