From 7f29f768dafb79c8d7e3dbecc4d086d533229a65 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Thu, 29 Apr 2021 11:17:52 +0200 Subject: [PATCH] Add nil check for crash prevention --- mods/CORE/mcl_util/init.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mods/CORE/mcl_util/init.lua b/mods/CORE/mcl_util/init.lua index f619b5465..f976457c0 100644 --- a/mods/CORE/mcl_util/init.lua +++ b/mods/CORE/mcl_util/init.lua @@ -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