Core/Entities: Fix null-dereference crash

Closes #19191

(cherrypicked from d61e0f79c4)
This commit is contained in:
ariel-
2017-02-23 02:09:44 -03:00
committed by Shauren
parent b428bfbd14
commit 5da9f724c3

View File

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