mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2025-01-10 02:27:28 +01:00
Add nil check for crash prevention
This commit is contained in:
parent
eae71fdf55
commit
7f29f768da
@ -532,6 +532,10 @@ function mcl_util.get_object_name(object)
|
|||||||
else
|
else
|
||||||
local luaentity = object:get_luaentity()
|
local luaentity = object:get_luaentity()
|
||||||
|
|
||||||
|
if not luaentity then
|
||||||
|
return ""
|
||||||
|
end
|
||||||
|
|
||||||
return luaentity.nametag and luaentity.nametag ~= "" and luaentity.nametag or luaentity.description or luaentity.name
|
return luaentity.nametag and luaentity.nametag ~= "" and luaentity.nametag or luaentity.description or luaentity.name
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user