From e0039f22f8dfbd9fc3f476ced9ddd8a37e70ea68 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Sat, 10 Jan 2015 01:31:22 -0500 Subject: sanity checking, stop crash in case of garbage inventory data (i.e. that looks like nil) --- autocrafter.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'autocrafter.lua') diff --git a/autocrafter.lua b/autocrafter.lua index a6d8ad1..b9edd93 100644 --- a/autocrafter.lua +++ b/autocrafter.lua @@ -9,7 +9,9 @@ local function make_inventory_cache(invlist) end local function autocraft(inventory, pos) + if not inventory then return end local recipe = inventory:get_list("recipe") + if not recipe then return end local recipe_last local result local new -- cgit v1.2.3