summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--car.lua2
1 files changed, 1 insertions, 1 deletions
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"