add nil check for ent

This commit is contained in:
TenPlus1 2017-07-29 14:51:28 +01:00
parent 12e1ca60df
commit 59e3dcdaad

View File

@ -147,7 +147,7 @@ local apply_shoes = function(name, itemstack, obj, shoes, speed, jump, reverse)
local mob = obj.ref
local ent = mob:get_luaentity()
if ent.name and ent.name == "mob_horse:horse" then
if ent and ent.name and ent.name == "mob_horse:horse" then
if ent.shoed then
minetest.add_item(mob:getpos(), ent.shoed)