summaryrefslogtreecommitdiff
path: root/autocrafter.lua
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2015-01-10 01:31:22 -0500
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2015-01-10 01:31:22 -0500
commite0039f22f8dfbd9fc3f476ced9ddd8a37e70ea68 (patch)
tree471f678a09e505fed240b10df5ddb0541f5556b1 /autocrafter.lua
parent6f16dd24c2dcd1de1dca87e9656498ea34331628 (diff)
downloadpipeworks-e0039f22f8dfbd9fc3f476ced9ddd8a37e70ea68.tar
pipeworks-e0039f22f8dfbd9fc3f476ced9ddd8a37e70ea68.tar.gz
pipeworks-e0039f22f8dfbd9fc3f476ced9ddd8a37e70ea68.tar.bz2
pipeworks-e0039f22f8dfbd9fc3f476ced9ddd8a37e70ea68.tar.xz
pipeworks-e0039f22f8dfbd9fc3f476ced9ddd8a37e70ea68.zip
sanity checking, stop crash in case of garbage inventory data
(i.e. that looks like nil)
Diffstat (limited to 'autocrafter.lua')
-rw-r--r--autocrafter.lua2
1 files changed, 2 insertions, 0 deletions
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