Fix crash on grant/revoke of vote_starter, when granter/revoker is nil
This commit is contained in:
parent
0eadaf9a96
commit
96636d4c88
1 changed files with 6 additions and 0 deletions
|
@ -4,10 +4,16 @@ local vlist = {} -- table storing player name, ip & lock status
|
||||||
minetest.register_privilege("vote_kick", {
|
minetest.register_privilege("vote_kick", {
|
||||||
description = "Can (start) vote to kick a player",
|
description = "Can (start) vote to kick a player",
|
||||||
on_grant = function(name, granter)
|
on_grant = function(name, granter)
|
||||||
|
if not granter then
|
||||||
|
granter = "<nil>"
|
||||||
|
end
|
||||||
minetest.log("warning", "Player '" .. name .. "' has been" ..
|
minetest.log("warning", "Player '" .. name .. "' has been" ..
|
||||||
" granted 'vote_kick' by '" .. granter .. "'")
|
" granted 'vote_kick' by '" .. granter .. "'")
|
||||||
end,
|
end,
|
||||||
on_revoke = function(name, revoker)
|
on_revoke = function(name, revoker)
|
||||||
|
if not revoker then
|
||||||
|
revoker = "<nil>"
|
||||||
|
end
|
||||||
minetest.log("warning", "Player '" .. name .. "' has been" ..
|
minetest.log("warning", "Player '" .. name .. "' has been" ..
|
||||||
" revoked of 'vote_kick' by '" .. revoker .. "'")
|
" revoked of 'vote_kick' by '" .. revoker .. "'")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue