From 7f9af238f8803667dfe66b8abb68207255d6f078 Mon Sep 17 00:00:00 2001 From: Uleat Date: Sat, 13 Aug 2016 19:51:12 -0400 Subject: [PATCH] Fix for potential crash in ItemInst::GetTotalItemCount() --- common/item.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/item.cpp b/common/item.cpp index 41e3d86c3..61e7f926a 100644 --- a/common/item.cpp +++ b/common/item.cpp @@ -1863,6 +1863,9 @@ uint8 ItemInst::FirstOpenSlot() const uint8 ItemInst::GetTotalItemCount() const { + if (!m_item) + return 0; + uint8 item_count = 1; if (m_item && !m_item->IsClassBag()) { return item_count; }