From 43ff75de84ee9bee5298fadb0e2055df84514f94 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 15 Mar 2021 01:20:23 -0400 Subject: [PATCH] Core/Commands: Fixes a crash when spell doesnt have Effect --- Source/Game/Chat/Commands/LookupCommands.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Game/Chat/Commands/LookupCommands.cs b/Source/Game/Chat/Commands/LookupCommands.cs index a2dbe7a5d..f6b0d4156 100644 --- a/Source/Game/Chat/Commands/LookupCommands.cs +++ b/Source/Game/Chat/Commands/LookupCommands.cs @@ -1128,9 +1128,9 @@ namespace Game.Chat bool known = target && target.HasSpell(spellInfo.Id); SpellEffectInfo effect = spellInfo.GetEffect(0); - bool learn = (effect.Effect == SpellEffectName.LearnSpell); + bool learn = effect?.Effect == SpellEffectName.LearnSpell; - SpellInfo learnSpellInfo = Global.SpellMgr.GetSpellInfo(effect.TriggerSpell, spellInfo.Difficulty); + SpellInfo learnSpellInfo = effect != null ? Global.SpellMgr.GetSpellInfo(effect.TriggerSpell, spellInfo.Difficulty) : null; bool talent = spellInfo.HasAttribute(SpellCustomAttributes.IsTalent); bool passive = spellInfo.IsPassive();