Core/Battle Pets: Fixed possible crash in packet handler

Port From (https://github.com/TrinityCore/TrinityCore/commit/ce8f9b9a4efc8a3f110465db5310f08067658f60)
This commit is contained in:
hondacrx
2019-11-13 19:13:56 -05:00
parent 289f7a735a
commit ae593507e6
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -35,7 +35,11 @@ namespace Game
{
BattlePetMgr.BattlePet pet = GetBattlePetMgr().GetPet(battlePetSetBattleSlot.PetGuid);
if (pet != null)
GetBattlePetMgr().GetSlot(battlePetSetBattleSlot.Slot).Pet = pet.PacketInfo;
{
BattlePetSlot slot = GetBattlePetMgr().GetSlot(battlePetSetBattleSlot.Slot);
if (slot != null)
slot.Pet = pet.PacketInfo;
}
}
[WorldPacketHandler(ClientOpcodes.BattlePetModifyName)]