Core/Spells: Fixed missing null checks on some SpellEffects
This commit is contained in:
@@ -443,7 +443,7 @@ namespace Game.Misc
|
|||||||
if (spellInfo != null)
|
if (spellInfo != null)
|
||||||
{
|
{
|
||||||
foreach (SpellEffectInfo effect in spellInfo.GetEffects())
|
foreach (SpellEffectInfo effect in spellInfo.GetEffects())
|
||||||
if (effect.IsEffect(SpellEffectName.LearnSpell))
|
if (effect != null && effect.IsEffect(SpellEffectName.LearnSpell))
|
||||||
packet.LearnSpells.Add(effect.TriggerSpell);
|
packet.LearnSpells.Add(effect.TriggerSpell);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3410,8 +3410,9 @@ namespace Game.Spells
|
|||||||
{
|
{
|
||||||
uint item = 0;
|
uint item = 0;
|
||||||
foreach (SpellEffectInfo effect in spellInfo.GetEffects())
|
foreach (SpellEffectInfo effect in spellInfo.GetEffects())
|
||||||
if (effect.ItemType != 0)
|
if (effect != null && effect.ItemType != 0)
|
||||||
item = effect.ItemType;
|
item = effect.ItemType;
|
||||||
|
|
||||||
ItemTemplate proto = Global.ObjectMgr.GetItemTemplate(item);
|
ItemTemplate proto = Global.ObjectMgr.GetItemTemplate(item);
|
||||||
if (proto != null && proto.GetItemLimitCategory() != 0)
|
if (proto != null && proto.GetItemLimitCategory() != 0)
|
||||||
packet.FailedArg1 = (int)proto.GetItemLimitCategory();
|
packet.FailedArg1 = (int)proto.GetItemLimitCategory();
|
||||||
|
|||||||
@@ -1248,7 +1248,7 @@ namespace Game.Entities
|
|||||||
SpellInfo spellInfo = GetSpellInfo(spellId, Difficulty.None);
|
SpellInfo spellInfo = GetSpellInfo(spellId, Difficulty.None);
|
||||||
foreach (SpellEffectInfo effectInfo in spellInfo.GetEffects())
|
foreach (SpellEffectInfo effectInfo in spellInfo.GetEffects())
|
||||||
{
|
{
|
||||||
if (!effectInfo.IsAura())
|
if (effectInfo == null || !effectInfo.IsAura())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
AuraType auraName = effectInfo.ApplyAuraName;
|
AuraType auraName = effectInfo.ApplyAuraName;
|
||||||
|
|||||||
Reference in New Issue
Block a user