Add nil check for clicker and item stack (#16)

This prevents crashes when on_rightclick is called by a mod.
master
coil 2019-08-18 16:10:47 -04:00 committed by FaceDeer
parent 200feb25bb
commit a6fa5984e2
1 changed files with 3 additions and 0 deletions

View File

@ -215,6 +215,9 @@ minetest.register_node("anvil:anvil", {
end,
on_rightclick = function(pos, node, clicker, itemstack)
if not clicker or not itemstack then
return
end
local meta = minetest.get_meta(pos)
local name = clicker:get_player_name()