From 40e7645a43256d5d90b90872c22caabd496a3de6 Mon Sep 17 00:00:00 2001 From: stujones11 Date: Mon, 2 Jun 2014 19:11:58 +0100 Subject: [PATCH] Prevent indexing a nil item --- shooter.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shooter.lua b/shooter.lua index f4b574c..2fbaa4a 100644 --- a/shooter.lua +++ b/shooter.lua @@ -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