From 3853c4f15058b58db3a4afee19efe78842953979 Mon Sep 17 00:00:00 2001 From: mmcgarvey Date: Mon, 3 Jan 2022 22:22:21 -0500 Subject: [PATCH] [Bug Fix] XTarget Changes Causing Crashes (#1915) * [Bugfix] XTarget Changes Causing Crashes Added nullptr check when processing XTargetAutoHaters for pet owner. * [Bugfix] XTarget Changes Causing Crashes Added another needed sanity check after the nullptr check. * [Bugfix] XTarget Changes Causing Crashes Added another check against nullptr. * [Bugfix] XTarget Changes Causing Crashes Cleaned up nullptr checks per PR comments. --- zone/attack.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/attack.cpp b/zone/attack.cpp index 173574641..3216b92d7 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -2571,7 +2571,7 @@ bool NPC::Death(Mob* killer_mob, int32 damage, uint16 spell, EQ::skills::SkillTy entity_list.RemoveFromAutoXTargets(this); - if (killer->GetUltimateOwner() && killer->GetUltimateOwner()->IsClient()) { + if (killer != nullptr && killer->GetUltimateOwner() && killer->GetUltimateOwner()->IsClient()) { killer->GetUltimateOwner()->CastToClient()->ProcessXTargetAutoHaters(); } uint16 emoteid = this->GetEmoteID();