From d3d844ab3199777db2d748ebdf369259184eedb9 Mon Sep 17 00:00:00 2001 From: cheapie Date: Sun, 21 Apr 2024 13:35:19 -0500 Subject: Fix possible crash in car top box right-click handling --- car.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/car.lua b/car.lua index 23aa121..9d9d191 100644 --- a/car.lua +++ b/car.lua @@ -307,7 +307,7 @@ local pieces = { local boxpos = vector.add(pos,vector.new(0,1,0)) local erefs = minetest.get_objects_inside_radius(boxpos,0.5) for _,ref in pairs(erefs) do - if ref:get_luaentity().name == "celevator:car_top_box" then + if ref:get_luaentity() and ref:get_luaentity().name == "celevator:car_top_box" then local state = ref:get_properties().wield_item if state == "celevator:car_top_box_off" then state = "celevator:car_top_box_on" -- cgit v1.2.3