From c52184846557141ebb70d3df9fc9139c8ced6152 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 15 Mar 2021 01:22:23 -0400 Subject: [PATCH] Core/Spells: Fixes a crash when powercosts doesnt contain the powertype. --- Source/Game/Spells/SpellInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Game/Spells/SpellInfo.cs b/Source/Game/Spells/SpellInfo.cs index 9e287aa8b..c9b9f3766 100644 --- a/Source/Game/Spells/SpellInfo.cs +++ b/Source/Game/Spells/SpellInfo.cs @@ -2677,7 +2677,7 @@ namespace Game.Spells public SpellPowerCost CalcPowerCost(PowerType powerType, bool optionalCost, Unit caster, SpellSchoolMask schoolMask, Spell spell = null) { - var spellPowerRecord = PowerCosts.First(spellPowerEntry => spellPowerEntry?.PowerType == powerType); + var spellPowerRecord = PowerCosts.FirstOrDefault(spellPowerEntry => spellPowerEntry?.PowerType == powerType); if (spellPowerRecord == null) return null;