From 14f7c8718c8b8acd3fea51d555ccb8c29f5f799b Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Sun, 29 Jan 2023 16:47:07 +0100 Subject: [PATCH] Fast fix for #115: bad argument #1 to 'pairs' (table expected, got nil) --- digtron/battery.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/digtron/battery.lua b/digtron/battery.lua index 515c314..5e5b6c0 100644 --- a/digtron/battery.lua +++ b/digtron/battery.lua @@ -30,7 +30,7 @@ local TOTAL_MAX = INV_SIZE * FUEL_STACK_MAX local function count_coal(metadata) local total = 0 - for _,stack in pairs(metadata.inventory.fuel) do + for _,stack in pairs(metadata.inventory.fuel or {}) do total = total + stack:get_count() end return total