Use empty string for protection check if puncher or clicker is nil.

This commit is contained in:
auouymous
2020-12-19 23:11:20 +03:00
committed by Vitaliy
parent 29ec26a4c8
commit 397d449f1e
3 changed files with 4 additions and 4 deletions

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@ minetest.register_node("mesecons_noteblock:noteblock", {
is_ground_content = false,
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2},
on_punch = function(pos, node, puncher) -- change sound when punched
if minetest.is_protected(pos, puncher and puncher:get_player_name()) then
if minetest.is_protected(pos, puncher and puncher:get_player_name() or "") then
return
end