summaryrefslogtreecommitdiff
path: root/src/inventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp
index 859213fe..58c75f2c 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -50,7 +50,7 @@ Inventory::~Inventory()
Item* Inventory::getItem(int index) const
{
- if (index < 0 || index >= INVENTORY_SIZE || mItems[index]->getQuantity() <= 0)
+ if (index < 0 || index >= INVENTORY_SIZE || !mItems[index] || mItems[index]->getQuantity() <= 0)
return 0;
return mItems[index];