diff --git a/zone/bot.cpp b/zone/bot.cpp index e864642be..3c12288a2 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -4533,8 +4533,10 @@ bool Bot::Death(Mob *killerMob, int64 damage, uint16 spell_id, EQ::skills::Skill give_exp_client = give_exp->CastToClient(); bool IsLdonTreasure = (GetClass() == LDON_TREASURE); - if (entity_list.GetCorpseByID(GetID())) - entity_list.GetCorpseByID(GetID())->Depop(); + const auto c = entity_list.GetCorpseByID(GetID()); + if (c) { + c->Depop(); + } if (HasRaid()) { if (auto raid = entity_list.GetRaidByBotName(GetName()); raid) { @@ -6831,8 +6833,11 @@ Bot* Bot::GetBotByBotClientOwnerAndBotName(Client* c, const std::string& botName void Bot::ProcessBotGroupInvite(Client* c, std::string const& botName) { if (c && !c->HasRaid()) { Bot* invitedBot = GetBotByBotClientOwnerAndBotName(c, botName); + if (!invitedBot) { + return; + } - if (invitedBot && !invitedBot->HasGroup() && !invitedBot->HasRaid()) { + if (!invitedBot->HasGroup() && !invitedBot->HasRaid()) { if (!c->IsGrouped()) { auto g = new Group(c); if (AddBotToGroup(invitedBot, g)) {