From bf62fe6db9d1e6729bf7ee599a170be985674298 Mon Sep 17 00:00:00 2001 From: osmarks Date: Wed, 15 Aug 2018 19:50:55 +0100 Subject: [PATCH] Stop crashing if no items --- IO.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IO.lua b/IO.lua index 0e20f62..f7f7b52 100644 --- a/IO.lua +++ b/IO.lua @@ -34,7 +34,7 @@ local function main() request.type = "extract" request.destination_inventory = conf.chest local result = w.unwrap(w.query_by_type("storage", request), "extracting items", { w.errors.NOITEMS }) - print("Moved", result.moved, item_name, "from storage.") + if result then print("Moved", result.moved, item_name, "from storage.") end end end @@ -49,7 +49,7 @@ local function main() from_inventory = conf.chest, from_slot = slot }), "inserting items") - print("Moved", result.moved, ii, "to storage.") + if result then print("Moved", result.moved, ii, "to storage.") end end end