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, 2 insertions, 0 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp
index 5ee1e34c0..61434754f 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -199,6 +199,8 @@ void Inventory::removeItem(const int id)
void Inventory::removeItemAt(const int index)
{
+ if (!mItems[index])
+ return;
delete2(mItems[index]);
mUsed--;
if (mUsed < 0) // Already at 0, no need to distribute event