Stop crashing if no items
This commit is contained in:
parent
d0d2815730
commit
bf62fe6db9
4
IO.lua
4
IO.lua
|
@ -34,7 +34,7 @@ local function main()
|
||||||
request.type = "extract"
|
request.type = "extract"
|
||||||
request.destination_inventory = conf.chest
|
request.destination_inventory = conf.chest
|
||||||
local result = w.unwrap(w.query_by_type("storage", request), "extracting items", { w.errors.NOITEMS })
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ local function main()
|
||||||
from_inventory = conf.chest,
|
from_inventory = conf.chest,
|
||||||
from_slot = slot
|
from_slot = slot
|
||||||
}), "inserting items")
|
}), "inserting items")
|
||||||
print("Moved", result.moved, ii, "to storage.")
|
if result then print("Moved", result.moved, ii, "to storage.") end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue