From 9817b389045d83f1353bebb77a4ba1dfa2907cba Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 8 Feb 2019 23:17:08 +0100 Subject: [PATCH] Fix bucket crash --- mods/ITEMS/mcl_buckets/init.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_buckets/init.lua b/mods/ITEMS/mcl_buckets/init.lua index f53cad4cec..5840346b64 100644 --- a/mods/ITEMS/mcl_buckets/init.lua +++ b/mods/ITEMS/mcl_buckets/init.lua @@ -327,7 +327,10 @@ if mod_mcl_core then "Right-click on any block to empty the bucket and put a water source on this spot.", function(pos, placer) -- Check protection - local placer_name = placer:get_player_name() + local placer_name = "" + if placer ~= nil then + placer_name = placer:get_player_name() + end if minetest.is_protected(pos, placer_name) then minetest.record_protection_violation(pos, placer_name) return false @@ -366,7 +369,10 @@ if mod_mclx_core then "Right-click on any block to empty the bucket and put a river water source on this spot.", function(pos, placer) -- Check protection - local placer_name = placer:get_player_name() + local placer_name = "" + if placer ~= nil then + placer_name = placer:get_player_name() + end if minetest.is_protected(pos, placer_name) then minetest.record_protection_violation(pos, placer_name) return false