diff --git a/src/PlayerbotMgr.cpp b/src/PlayerbotMgr.cpp index 97bdb312..63d847c8 100644 --- a/src/PlayerbotMgr.cpp +++ b/src/PlayerbotMgr.cpp @@ -1052,7 +1052,7 @@ void PlayerbotsMgr::RemovePlayerBotData(ObjectGuid const& guid) PlayerbotAI* PlayerbotsMgr::GetPlayerbotAI(Player* player) { - if (!player) + if (!player || !player->IsInWorld()) { return nullptr; } @@ -1068,7 +1068,7 @@ PlayerbotAI* PlayerbotsMgr::GetPlayerbotAI(Player* player) PlayerbotMgr* PlayerbotsMgr::GetPlayerbotMgr(Player* player) { - if (!player) + if (!player || !player->IsInWorld()) { return nullptr; }