summaryrefslogtreecommitdiff
path: root/car.lua
diff options
context:
space:
mode:
Diffstat (limited to 'car.lua')
-rw-r--r--car.lua2
1 files changed, 1 insertions, 1 deletions
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