Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 18e835a

Browse files
committed
Safety check in buy menu to hopefully fix an edge case crash
1 parent bdecd73 commit 18e835a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Menus/BuyMenuGUI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1954,7 +1954,7 @@ void BuyMenuGUI::Update()
19541954
int lastItemToDelete = m_pCartList->GetItemList()->size() - 1;
19551955
for (int i = m_ListItemIndex + 1; i != m_pCartList->GetItemList()->size(); i++) {
19561956
GUIListPanel::Item *cartItem = m_pCartList->GetItem(i);
1957-
if (dynamic_cast<const Actor *>(cartItem->m_pEntity)) {
1957+
if (!cartItem || dynamic_cast<const Actor *>(cartItem->m_pEntity)) {
19581958
lastItemToDelete = i - 1;
19591959
break;
19601960
}

0 commit comments

Comments
 (0)