Prevent indexing a nil item
This commit is contained in:
parent
4d0fd5b93c
commit
40e7645a43
1 changed files with 4 additions and 1 deletions
|
@ -55,7 +55,10 @@ local function punch_node(pos, def)
|
|||
return
|
||||
end
|
||||
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
|
||||
local level = item.groups[k] or 0
|
||||
if level >= v then
|
||||
|
|
Loading…
Reference in a new issue