summaryrefslogtreecommitdiff
path: root/src/inventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp
index acd35efdd..f907b2cc2 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -155,6 +155,9 @@ void Inventory::removeItemAt(int index)
bool Inventory::contains(Item *item) const
{
+ if (!item)
+ return false;
+
for (unsigned i = 0; i < mSize; i++)
{
if (mItems[i] && mItems[i]->getId() == item->getId())