summaryrefslogtreecommitdiff
path: root/src/inventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp
index 3ff40374a..f907b2cc2 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -22,7 +22,7 @@
#include "inventory.h"
#include "item.h"
-#include "log.h"
+#include "logger.h"
#include "net/inventoryhandler.h"
#include "net/net.h"
@@ -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())