Core/Battleground: Attempt to fix a crash

Please report this error if you get it

(cherry picked from commit d1f9cf84a5fa4a91b70e7d9769a3f41ba8a94a9c)
This commit is contained in:
jackpoz
2021-12-31 20:33:52 +01:00
committed by Shauren
parent ed2219f0be
commit 89cb6bc683
@@ -1722,6 +1722,12 @@ void Battleground::EndNow()
// buffs are in their positions when battleground starts
void Battleground::HandleTriggerBuff(ObjectGuid go_guid)
{
if (!FindBgMap())
{
TC_LOG_ERROR("bg.battleground", "Battleground::HandleTriggerBuff called with null bg map, %s", go_guid.ToString().c_str());
return;
}
GameObject* obj = GetBgMap()->GetGameObject(go_guid);
if (!obj || obj->GetGoType() != GAMEOBJECT_TYPE_TRAP || !obj->isSpawned())
return;