From f20c99d2bffe798806790e1f1ae838bba494d93c Mon Sep 17 00:00:00 2001
From: Andrei Karas <akaras@inbox.ru>
Date: Tue, 22 Mar 2016 13:40:32 +0300
Subject: Add missing check in inventory.

---
 src/resources/inventory/inventory.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'src/resources/inventory')

diff --git a/src/resources/inventory/inventory.cpp b/src/resources/inventory/inventory.cpp
index efcea0f55..7d78605dc 100644
--- a/src/resources/inventory/inventory.cpp
+++ b/src/resources/inventory/inventory.cpp
@@ -180,7 +180,8 @@ void Inventory::setCards(const int index,
     }
 
     Item *const item1 = mItems[index];
-    item1->setCards(cards, size);
+    if (item1)
+        item1->setCards(cards, size);
 }
 
 void Inventory::clear()
-- 
cgit v1.2.3-70-g09d2