builtin/.../falling.lua: Avoid crash when hitting unknown nodes
authorsfan5 <sfan5@live.de>
Mon, 9 Jan 2017 15:39:40 +0000 (16:39 +0100)
committersfan5 <sfan5@live.de>
Mon, 9 Jan 2017 15:39:40 +0000 (16:39 +0100)
builtin/game/falling.lua

index 4696ce4818ffd9e279ccc5d600f2efd8a48ca47c..39a74008cdd2b2e972fdc76b6da3f940b9256a95 100644 (file)
@@ -83,7 +83,7 @@ core.register_entity(":__builtin:falling_node", {
                        -- it's drops
                        if n2.name ~= "air" and (not nd or nd.liquidtype == "none") then
                                core.remove_node(np)
-                               if nd.buildable_to == false then
+                               if nd and nd.buildable_to == false then
                                        -- Add dropped items
                                        local drops = core.get_node_drops(n2.name, "")
                                        for _, dropped_item in pairs(drops) do