summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index e5a46b4..0397a1d 100644
--- a/init.lua
+++ b/init.lua
@@ -104,6 +104,11 @@ end
-- Extract suitable item description for formspec
local description_for_formspec = function(itemstring)
+ if minetest.registered_items[itemstring] == nil then
+ -- Huh? The item doesn't exist for some reason. Better give a dummy string
+ minetest.log("warning", "[doc] Unknown item detected: "..tostring(itemstring))
+ return S("Unknown item (@1)", tostring(itemstring))
+ end
local description = minetest.registered_items[itemstring].description
if description == nil or description == "" then
return minetest.formspec_escape(itemstring)