From 482782d74c61e226ed1ce81700708244565291f5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 25 Jun 2015 23:58:16 +0300 Subject: Add missing checks into net directory. --- src/net/eathena/inventoryhandler.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/net/eathena/inventoryhandler.cpp') diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp index 8406575bd..0e90235f6 100644 --- a/src/net/eathena/inventoryhandler.cpp +++ b/src/net/eathena/inventoryhandler.cpp @@ -406,6 +406,8 @@ void InventoryHandler::insertCard(const int cardIndex, void InventoryHandler::favoriteItem(const Item *const item, const bool favorite) const { + if (!item) + return; createOutPacket(CMSG_PLAYER_FAVORITE_ITEM); outMsg.writeInt16(static_cast(item->getInvIndex() + INVENTORY_OFFSET), @@ -802,6 +804,8 @@ void InventoryHandler::processPlayerInsertCard(Net::MessageIn &msg) void InventoryHandler::selectEgg(const Item *const item) const { + if (!item) + return; createOutPacket(CMSG_PET_SELECT_EGG); outMsg.writeInt16(static_cast( item->getInvIndex() + INVENTORY_OFFSET), "index"); -- cgit v1.2.3-70-g09d2