From a801db1fe060f91eae5edebfc93df31c7fb24902 Mon Sep 17 00:00:00 2001 From: jp Date: Tue, 22 Dec 2015 17:04:23 +0100 Subject: [PATCH] Attempt to fix a nil value on right-clicking worktable with non-updated metadatas --- worktable.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/worktable.lua b/worktable.lua index e9c6c4e..dc5da40 100644 --- a/worktable.lua +++ b/worktable.lua @@ -264,10 +264,13 @@ function worktable.fields(pos, _, fields, sender) local formspec = meta:to_table().fields.formspec local filter = formspec:match("filter;;([%w_:]+)") or "" local start_i = tonumber(formspec:match("inv_items_list;.*;(%d+)%]")) or 0 - local inventory_size = #meta:to_table().inventory.inv_items_list or 0 local inputstack = inv:get_stack("item_craft_input", 1):get_name() local recipe_num = meta:get_int("recipe_num") + if meta:to_table().inventory.inv_items_list then + local inventory_size = #meta:to_table().inventory.inv_items_list or 0 + end + if fields.storage then worktable.storage(pos) elseif fields.back then