From 87c223b142bc72fdc037f1ca063a74caec8625e1 Mon Sep 17 00:00:00 2001 From: cheapie Date: Fri, 10 Jun 2016 16:10:23 -0500 Subject: Fix rare crash when unknown entities are within the lightstone --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 539deab..609e500 100644 --- a/init.lua +++ b/init.lua @@ -124,7 +124,7 @@ minetest.register_node("rgblightstone:rgblightstone", { --Remove old entity, if present local objs = minetest.get_objects_inside_radius(pos,0.5) for _,obj in ipairs(objs) do - if obj:get_luaentity().name == "rgblightstone:entity" then + if obj:get_luaentity() and obj:get_luaentity().name == "rgblightstone:entity" then obj:remove() end end @@ -148,7 +148,7 @@ minetest.register_lbm({ action = function(pos) local objs = minetest.get_objects_inside_radius(pos,0.5) for _,obj in ipairs(objs) do - if obj:get_luaentity().name == "rgblightstone:entity" then + if obj:get_luaentity() and obj:get_luaentity().name == "rgblightstone:entity" then obj:remove() end end -- cgit v1.2.3