Fix crash when using the screwdriver on an unknown node
authorShadowNinja <noreply@gmail.com>
Thu, 16 Jan 2014 23:32:13 +0000 (18:32 -0500)
committerShadowNinja <noreply@gmail.com>
Thu, 16 Jan 2014 23:32:13 +0000 (18:32 -0500)
mods/screwdriver/init.lua

index 6f99aa571c9e2d26f379bae3f08b7616b33aadb1..27e1b41254f31b80cf9375b590ce58f3a310f553 100644 (file)
@@ -71,9 +71,8 @@ local function screwdriver_handler(itemstack, user, pointed_thing)
                return
        end
        local node = minetest.get_node(pos)
-       local node_name = node.name
        local ndef = minetest.registered_nodes[node.name]
-       if ndef.paramtype2 == "facedir" then
+       if ndef and ndef.paramtype2 == "facedir" then
                if ndef.drawtype == "nodebox" and ndef.node_box.type ~= "fixed" then
                        return
                end