From 397619e2f97e3f6ab558033abb6b778e5ec48d08 Mon Sep 17 00:00:00 2001 From: Uleat Date: Tue, 5 Nov 2019 18:58:46 -0500 Subject: [PATCH] Added safety check to [tar] dereference --- zone/merc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/merc.cpp b/zone/merc.cpp index 13f352033..4e635fe72 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -2156,7 +2156,7 @@ bool Merc::AICastSpell(int8 iChance, uint32 iSpellTypes) { if(castedSpell) { char* gmsg = nullptr; - if(tar != this) { + if(tar && tar != this) { // [tar] was implicitly valid at this point..this change is to catch any bad logic //we don't need spam of bots healing themselves MakeAnyLenString(&gmsg, "Casting %s on %s.", spells[selectedMercSpell.spellid].name, tar->GetCleanName()); if(gmsg)