Stop crashing if no items

This commit is contained in:
osmarks 2018-08-15 19:50:55 +01:00
parent d0d2815730
commit bf62fe6db9
1 changed files with 2 additions and 2 deletions

4
IO.lua
View File

@ -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