mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 01:53:45 +01:00
Make GUIinventoryMenu::drawList more robust with invalid data
This commit is contained in:
parent
b8cf6dee3e
commit
b235e4d290
@ -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 "
|
||||
<<"\""<<s.inventoryloc.dump()<<"\" doesn't exist"
|
||||
<<std::endl;
|
||||
return;
|
||||
}
|
||||
InventoryList *ilist = inv->getList(s.listname);
|
||||
if(!ilist){
|
||||
infostream<<"GUIInventoryMenu::drawList(): WARNING: "
|
||||
<<"The inventory list \""<<s.listname<<"\" @ \""
|
||||
<<s.inventoryloc.dump()<<"\" doesn't exist"
|
||||
<<std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
core::rect<s32> imgrect(0,0,imgsize.X,imgsize.Y);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user