From d18f9b425111c5bbb5df6d28b9c2b689949516d0 Mon Sep 17 00:00:00 2001 From: mckaygerhard Date: Thu, 14 Apr 2022 20:57:56 -0400 Subject: [PATCH] Do not crash when a skeleton key is used on an unknown node * backported from default MT 5.1+ --- mods/default/craftitems.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mods/default/craftitems.lua b/mods/default/craftitems.lua index e1d224d..ed32306 100644 --- a/mods/default/craftitems.lua +++ b/mods/default/craftitems.lua @@ -216,7 +216,8 @@ minetest.register_craftitem("default:skeleton_key", { return itemstack end - local on_skeleton_key_use = minetest.registered_nodes[node.name].on_skeleton_key_use + local node_reg = minetest.registered_nodes[node.name] + local on_skeleton_key_use = node_reg and node_reg.on_skeleton_key_use if not on_skeleton_key_use then return itemstack end