summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorJP Guerrero <jeanpatrick.guerrero@gmail.com>2016-12-13 22:44:40 +0100
committerJP Guerrero <jeanpatrick.guerrero@gmail.com>2016-12-13 22:44:40 +0100
commit5113dc407a99bec1caa7329979db91ac49108c04 (patch)
treed5e9e4cc5555a71aad4fcd7c8ded6ebb8d357f26 /init.lua
parentf321647a6bba536f2a3715ae1d22436b2c3f68e3 (diff)
Fix nil crash when recipe item is unknown
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index 12a58fc..56bae65 100644
--- a/init.lua
+++ b/init.lua
@@ -46,7 +46,10 @@ function craftguide:get_tooltip(item, recipe_type, cooktime, groups)
local fueltime = minetest.get_craft_result({
method="fuel", width=1, items={item}}).time
local has_extras = groups or recipe_type == "cooking" or fueltime > 0
- local item_desc = groups and "" or minetest.registered_items[item].description
+ local item_desc = ""
+ if minetest.registered_items[item] and not groups then
+ item_desc = minetest.registered_items[item].description
+ end
if groups then
local groupstr = "Any item belonging to the "