summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2024-04-22 17:23:03 -0500
committercheapie <no-email-for-you@example.com>2024-04-22 17:23:03 -0500
commitb96d939f9827731cdc2d7cdaf1995f5182e95241 (patch)
tree33f15143a92936bf0005e4bd5f7523d59caac078
parentdd123078613eb6a51d62826c746e58cf64241657 (diff)
downloadcelevator-b96d939f9827731cdc2d7cdaf1995f5182e95241.tar
celevator-b96d939f9827731cdc2d7cdaf1995f5182e95241.tar.gz
celevator-b96d939f9827731cdc2d7cdaf1995f5182e95241.tar.bz2
celevator-b96d939f9827731cdc2d7cdaf1995f5182e95241.tar.xz
celevator-b96d939f9827731cdc2d7cdaf1995f5182e95241.zip
Fix possible crash when removing car
-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