From b96d939f9827731cdc2d7cdaf1995f5182e95241 Mon Sep 17 00:00:00 2001 From: cheapie Date: Mon, 22 Apr 2024 17:23:03 -0500 Subject: Fix possible crash when removing car --- car.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/car.lua b/car.lua index 9d9d191..2f7452c 100644 --- a/car.lua +++ b/car.lua @@ -668,7 +668,7 @@ minetest.register_on_player_receive_fields(function(_,formname,fields) minetest.remove_node(piecepos) local erefs = minetest.get_objects_inside_radius(piecepos,0.5) for _,ref in pairs(erefs) do - if toberemoved[ref:get_luaentity().name] then + if ref:get_luaentity() and toberemoved[ref:get_luaentity().name] then ref:remove() end end -- cgit v1.2.3