summaryrefslogtreecommitdiff
path: root/src/net/eathena/inventoryhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-25 23:58:16 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-25 23:58:16 +0300
commit482782d74c61e226ed1ce81700708244565291f5 (patch)
treec955925952f091cdc71af8b1e7f8b3cdabecfa6b /src/net/eathena/inventoryhandler.cpp
parentee12c6e77bd4d34d5fa682361127add32cc1a184 (diff)
downloadplus-482782d74c61e226ed1ce81700708244565291f5.tar.gz
plus-482782d74c61e226ed1ce81700708244565291f5.tar.bz2
plus-482782d74c61e226ed1ce81700708244565291f5.tar.xz
plus-482782d74c61e226ed1ce81700708244565291f5.zip
Add missing checks into net directory.
Diffstat (limited to 'src/net/eathena/inventoryhandler.cpp')
-rw-r--r--src/net/eathena/inventoryhandler.cpp4
1 files changed, 4 insertions, 0 deletions
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<int16_t>(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<int16_t>(
item->getInvIndex() + INVENTORY_OFFSET), "index");