Attempt to avoid crashing on unregistered items.

This commit is contained in:
Auke Kok 2017-04-17 14:06:00 -07:00
parent 4e5e14ee0f
commit d01f56e3a5

View File

@ -95,7 +95,11 @@ function frame.register(name)
if not def then
-- item?
def = minetest.registered_items[name]
assert(def, "not a thing: ".. name)
if not def then
-- nonexistant item.
minetest.log("warning", "Frame registered for \"" .. name .. "\" but it isn't registered")
return
end
assert(def.inventory_image, "no inventory image for " .. name)
tiles = {