Prevent indexing a nil item

This commit is contained in:
stujones11 2014-06-02 19:11:58 +01:00
parent 4d0fd5b93c
commit 40e7645a43

View file

@ -55,7 +55,10 @@ local function punch_node(pos, def)
return return
end end
local item = minetest.registered_items[node.name] local item = minetest.registered_items[node.name]
if item and item.groups then if not item then
return
end
if item.groups then
for k, v in pairs(def.groups) do for k, v in pairs(def.groups) do
local level = item.groups[k] or 0 local level = item.groups[k] or 0
if level >= v then if level >= v then