Core/Entities: Fix null-dereference crash

Closes #19191

(cherry picked from commit d61e0f79c4)
This commit is contained in:
ariel-
2017-02-23 02:09:44 -03:00
committed by funjoker
parent b8d1bab8de
commit 827fcb652a

View File

@@ -8053,7 +8053,7 @@ void Player::CastItemCombatSpell(DamageInfo const& damageInfo, Item* item, ItemT
// reduce effect values if enchant is limited
CastSpellExtraArgs args(item);
if ((entry->AttributesMask & ENCHANT_PROC_ATTR_LIMIT_60) && target->getLevel() > 60)
if (entry && (entry->AttributesMask & ENCHANT_PROC_ATTR_LIMIT_60) && target->getLevel() > 60)
{
int32 const lvlDifference = target->getLevel() - 60;
int32 const lvlPenaltyFactor = 4; // 4% lost effectiveness per level