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
+1 -1
View File
@@ -454,7 +454,7 @@ namespace Game.BattlePets
_owner.SendPacket(battlePetError);
}
public BattlePetSlot GetSlot(byte slot) { return _slots[slot]; }
public BattlePetSlot GetSlot(byte slot) { return slot < _slots.Count ? _slots[slot] : null; }
WorldSession GetOwner() { return _owner; }
public ushort GetTrapLevel() { return _trapLevel; }