From 699a379acfd8461a323f6f00c74ebd3ce07ed509 Mon Sep 17 00:00:00 2001 From: Niklp <89982526+Niklp09@users.noreply.github.com> Date: Sun, 19 Nov 2023 19:32:08 +0100 Subject: [PATCH] Fix nil error when accessing brasier inventory (#7) When node timers are not deleted by a map operation, the inventory might no longer be present. This properly skips further logic such cases. --- brasier.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/brasier.lua b/brasier.lua index 7e5547f..af93dd4 100644 --- a/brasier.lua +++ b/brasier.lua @@ -41,6 +41,8 @@ local brasier_burn = function(pos) if timer:is_started() and node_above.name == "fire:permanent_flame" then return end local inv = minetest.get_inventory({type="node", pos=pos}) + if not inv then return end -- Stop nodetimer + local item = inv:get_stack("fuel", 1) local fuel_burned = minetest.get_craft_result({method="fuel", width=1, items={item:peek_item(1)}}).time