summaryrefslogtreecommitdiff
path: root/src/net/eathena/inventoryhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-07-21 00:47:44 +0300
committerAndrei Karas <akaras@inbox.ru>2015-07-21 00:47:44 +0300
commitfffbd86a1014ad169ed2d68ea58cdddf346faa14 (patch)
tree713c96fcf7421ca87f638d312e752179281cb8fe /src/net/eathena/inventoryhandler.cpp
parent1941b81a5a278f26a5d7e1f91903ab04c92e2cd1 (diff)
downloadmv-fffbd86a1014ad169ed2d68ea58cdddf346faa14.tar.gz
mv-fffbd86a1014ad169ed2d68ea58cdddf346faa14.tar.bz2
mv-fffbd86a1014ad169ed2d68ea58cdddf346faa14.tar.xz
mv-fffbd86a1014ad169ed2d68ea58cdddf346faa14.zip
Add missing checks and non null attributes.
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 015ff3c2c..86faea2e7 100644
--- a/src/net/eathena/inventoryhandler.cpp
+++ b/src/net/eathena/inventoryhandler.cpp
@@ -803,6 +803,8 @@ void InventoryHandler::processPlayerUseCard(Net::MessageIn &msg)
for (int f = 0; f < count; f ++)
{
const int itemIndex = msg.readInt16("item index") - INVENTORY_OFFSET;
+ if (!inv)
+ continue;
const Item *const item = inv->getItem(itemIndex);
if (!item)
continue;
@@ -822,6 +824,8 @@ void InventoryHandler::processPlayerInsertCard(Net::MessageIn &msg)
{
NotifyManager::notify(NotifyTypes::CARD_INSERT_SUCCESS);
Inventory *const inv = PlayerInfo::getInventory();
+ if (!inv)
+ return;
Item *const card = inv->getItem(cardIndex);
int cardId = 0;
if (card)