From be269b2034972479482d00aa0df4475a2f033b59 Mon Sep 17 00:00:00 2001 From: ancientmarinerdev Date: Tue, 14 Mar 2023 15:19:39 +0000 Subject: [PATCH] Make error handling safe in case pos is missing --- mods/ENTITIES/mcl_mobs/api.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 355f40413..455ca47d9 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -510,9 +510,11 @@ function mob_class:on_step(dtime) else warn_user_error () local pos = self.object:get_pos() - local node = minetest.get_node(pos) - if node and node.name == "ignore" then - minetest.log("warning", "Pos is ignored: " .. dump(pos)) + if pos then + local node = minetest.get_node(pos) + if node and node.name == "ignore" then + minetest.log("warning", "Pos is ignored: " .. dump(pos)) + end end log_error (dump(retVal), dump(pos), dump(self)) end