If there was no source item in a furnace it would cause a segmentation fault.
[oweals/minetest.git] / src / inventory.cpp
index 62aedb536aee407b4309706c8b4b8c1b2c36c3aa..116ceeb6df3a838fb06c06ac4a817878d4625eef 100644 (file)
@@ -581,6 +581,8 @@ bool InventoryList::roomForItem(const InventoryItem *item)
 
 bool InventoryList::roomForCookedItem(const InventoryItem *item)
 {
+       if(!item)
+               return false;
        const InventoryItem *cook = item->createCookResult();
        if(!cook)
                return false;