Fix crash on grant/revoke of vote_starter, when granter/revoker is nil

This commit is contained in:
Thomas--S 2019-05-10 14:09:01 +02:00 committed by ANAND ︻气デ═一
parent 0eadaf9a96
commit 96636d4c88

View file

@ -4,10 +4,16 @@ local vlist = {} -- table storing player name, ip & lock status
minetest.register_privilege("vote_kick", {
description = "Can (start) vote to kick a player",
on_grant = function(name, granter)
if not granter then
granter = "<nil>"
end
minetest.log("warning", "Player '" .. name .. "' has been" ..
" granted 'vote_kick' by '" .. granter .. "'")
end,
on_revoke = function(name, revoker)
if not revoker then
revoker = "<nil>"
end
minetest.log("warning", "Player '" .. name .. "' has been" ..
" revoked of 'vote_kick' by '" .. revoker .. "'")
end