mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-26 04:21:07 +01:00
Add nil check for crash prevention
This commit is contained in:
parent
33c0aa23c5
commit
199488cc74
1 changed files with 4 additions and 0 deletions
|
@ -532,6 +532,10 @@ function mcl_util.get_object_name(object)
|
|||
else
|
||||
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
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue