Merge pull request #174 from Rui-Minetest/patch-1

Add nil check for egg_entity
This commit is contained in:
tacigar 2018-06-14 23:13:48 +09:00 committed by GitHub
commit b574f4495a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -162,7 +162,9 @@ do -- register egg writer
local function on_metadata_inventory_take_from_main(pos)
local egg_entity = get_nearest_egg_entity(pos)
egg_entity.object:remove()
if egg_entity then
egg_entity.object:remove()
end
end
maidroid_tool._aux.register_writer("maidroid_tool:egg_writer", {