Skip to content
Permalink
Browse files

Do not crash when a skeleton key is used on an unknown node (#2806)

  • Loading branch information
Montandalar committed Jan 15, 2021
1 parent 1ade894 commit 87f6b941c42d649f09ae9f720645be4fbc39346f
Showing with 2 additions and 1 deletion.
  1. +2 −1 mods/default/craftitems.lua
@@ -160,7 +160,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

0 comments on commit 87f6b94

Please sign in to comment.