From faba1d8149d998d592703362733807e2fd47ad23 Mon Sep 17 00:00:00 2001 From: Andrii Date: Sat, 10 Aug 2024 19:15:33 +0300 Subject: [PATCH] Fix crash because of prev_time == nil --- inventory.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inventory.lua b/inventory.lua index 624b9de..617faa5 100644 --- a/inventory.lua +++ b/inventory.lua @@ -29,7 +29,7 @@ local function send_message(pos, action, stack, from_slot, to_slot, side) -- Check if we need to include the current signal into batch -- Store "prev_time" in metadata as a string to avoid integer overflow - local prev_time = tonumber(meta:get_string("prev_time")) + local prev_time = tonumber(meta:get_string("prev_time") or "0") local cur_time = minetest.get_us_time() meta:set_string("prev_time", tostring(cur_time)) if cur_time - prev_time < 1000000 * interval_to_batch then