add some safety checks to update_builder_item

This commit is contained in:
FaceDeer 2019-08-18 14:19:19 -06:00
parent b394214ffa
commit d0ce43e2fe

@ -312,6 +312,7 @@ digtron.update_builder_item = function(pos)
digtron.remove_builder_item(pos)
node_inventory_table.pos = pos
local inv = minetest.get_inventory(node_inventory_table)
if inv == nil or inv:get_size("main") < 1 then return end
local item_stack = inv:get_stack("main", 1)
if not item_stack:is_empty() then
digtron.create_builder_item = item_stack:get_name()