From 556b80bc22635ae9919434e27ea93a6f47d56dde Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Sun, 13 Jan 2019 11:19:40 -0700 Subject: [PATCH] Another guard against a nil that shouldn't be possible --- util.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util.lua b/util.lua index e434ee5..e791f23 100644 --- a/util.lua +++ b/util.lua @@ -190,6 +190,11 @@ digtron.burn = function(fuelstore_positions, target, test) node_inventory_table.pos = location.pos local inv = minetest.get_inventory(node_inventory_table) local invlist = inv:get_list("fuel") + + if invlist == nil then -- This check shouldn't be needed, it's yet another guard against https://github.com/minetest/minetest/issues/8067 + break + end + for i, itemstack in pairs(invlist) do fuel_craft.items[1] = itemstack:peek_item(1) local fuel_per_item = minetest.get_craft_result(fuel_craft).time @@ -241,7 +246,7 @@ digtron.tap_batteries = function(battery_positions, target, test) local inv = minetest.get_inventory(node_inventory_table) local invlist = inv:get_list("batteries") - if (invlist == nil) then + if (invlist == nil) then -- This check shouldn't be needed, it's yet another guard against https://github.com/minetest/minetest/issues/8067 break end