From 32bc182d01adda000ba3486e5daf554879fb75e7 Mon Sep 17 00:00:00 2001 From: teknomunk Date: Mon, 23 Sep 2024 19:31:09 -0500 Subject: [PATCH] Prevent dereferencing nil in wither.lua, fix minor typo in debug statement --- mods/ENTITIES/mobs_mc/wither.lua | 3 ++- mods/ITEMS/vl_projectile/init.lua | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/wither.lua b/mods/ENTITIES/mobs_mc/wither.lua index 5f9fa32f1..21b930500 100644 --- a/mods/ENTITIES/mobs_mc/wither.lua +++ b/mods/ENTITIES/mobs_mc/wither.lua @@ -467,7 +467,8 @@ mcl_mobs.register_arrow("mobs_mc:wither_skull", { _lifetime = 15, on_punch = function(self) end, allow_punching = function(self, _, _, object) - return object:get_luaentity().name ~= "mobs_mc:wither" + local le = object and object:get_luaentity() + return le and le.name ~= "mobs_mc:wither" end, -- direct hit diff --git a/mods/ITEMS/vl_projectile/init.lua b/mods/ITEMS/vl_projectile/init.lua index 62796514b..216b3ff36 100644 --- a/mods/ITEMS/vl_projectile/init.lua +++ b/mods/ITEMS/vl_projectile/init.lua @@ -256,7 +256,7 @@ local function handle_entity_collision(self, entity_def, projectile_def, object) end if DEBUG then - minetest.log("handle_enity_collision("..dump({ + minetest.log("handle_entity_collision("..dump({ self = self, allow_punching = allow_punching, entity_def = entity_def,