Core/Unit: added missing nullptr check in IsImmunedToSpellEffect

Closes #18461
This commit is contained in:
ariel- authored and roc13x committed 2017-05-04 03:29:20 +01:00
1 parent 6e62130e96
commit f12035a600
1 file changed
+2 -2
+2 -2
View File
@@ -7778,8 +7778,8 @@ bool Unit::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index, Unit
// Check for immune to application of harmful magical effects
AuraEffectList const& immuneAuraApply = GetAuraEffectsByType(SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL);
for (AuraEffectList::const_iterator iter = immuneAuraApply.begin(); iter != immuneAuraApply.end(); ++iter)
if (((*iter)->GetMiscValue() & spellInfo->GetSchoolMask()) && // Check school
(!IsFriendlyTo(caster) || !spellInfo->IsPositiveEffect(index))) // Harmful
if (((*iter)->GetMiscValue() & spellInfo->GetSchoolMask()) && // Check school
((caster && !IsFriendlyTo(caster)) || !spellInfo->IsPositiveEffect(index))) // Harmful
return true;
}
}