From b235e4d290e3565a2789ec5097d33b1ec9dbb5ce Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sat, 2 Jun 2012 15:28:12 +0300 Subject: [PATCH] Make GUIinventoryMenu::drawList more robust with invalid data --- src/guiInventoryMenu.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/guiInventoryMenu.cpp b/src/guiInventoryMenu.cpp index 51001eee..e637ab78 100644 --- a/src/guiInventoryMenu.cpp +++ b/src/guiInventoryMenu.cpp @@ -284,8 +284,21 @@ void GUIInventoryMenu::drawList(const ListDrawSpec &s, int phase) font = skin->getFont(); Inventory *inv = m_invmgr->getInventory(s.inventoryloc); - assert(inv); + if(!inv){ + infostream<<"GUIInventoryMenu::drawList(): WARNING: " + <<"The inventory location " + <<"\""<getList(s.listname); + if(!ilist){ + infostream<<"GUIInventoryMenu::drawList(): WARNING: " + <<"The inventory list \""< imgrect(0,0,imgsize.X,imgsize.Y); -- 2.30.2