Avoid a nil index crash
authorKyle <khonkhortisan@gmail.com>
Fri, 22 Feb 2013 01:07:20 +0000 (17:07 -0800)
committerKyle <khonkhortisan@gmail.com>
Fri, 22 Feb 2013 01:14:38 +0000 (17:14 -0800)
technic/frames.lua

index 0e095bdb78349ad84950ca40d1f669d83724f53a..f555368722fcf37975cb1f709df39e4f2774e56a 100644 (file)
@@ -373,8 +373,8 @@ function move_nodes_vect(poslist,vect)
        end
        for _,obj in ipairs(objects) do
                obj:setpos(addVect(obj:getpos(),vect))
-               if obj:get_luaentity().name == "pipeworks:tubed_item" then
-                       le=obj:get_luaentity()
+               le=obj:get_luaentity()
+               if le and le.name == "pipeworks:tubed_item" then
                        le.start_pos=addVect(le.start_pos,vect)
                end
        end