diff --git a/source/game/StarPlayerInventory.cpp b/source/game/StarPlayerInventory.cpp index 0d74e05..c820459 100644 --- a/source/game/StarPlayerInventory.cpp +++ b/source/game/StarPlayerInventory.cpp @@ -1008,9 +1008,10 @@ ItemPtr& PlayerInventory::retrieve(InventorySlot const& slot) { if (auto es = slot.ptr()) return guardEmpty(m_equipment[*es]); - else if (auto bs = slot.ptr()) - return guardEmpty(m_bags[bs->first]->at(bs->second)); - else if (slot.is()) + else if (auto bs = slot.ptr()) { + if (auto bag = m_bags.ptr(bs->first)) + return guardEmpty((*bag)->at(bs->second)); + } else if (slot.is()) return guardEmpty(m_swapSlot); else return guardEmpty(m_trashSlot);