aboutsummaryrefslogtreecommitdiff
path: root/builtin/game
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2017-09-08 23:45:56 +0100
committerrubenwardy <rw@rubenwardy.com>2017-09-08 23:45:56 +0100
commitfaad6479defa30dec10cf4394c1da6fdf8f12f19 (patch)
tree933cb8a8a6aa9536222967af849416b83bb8e851 /builtin/game
parent745a90dc84339774a37fddff480dd60c69f4cc2a (diff)
downloadminetest-faad6479defa30dec10cf4394c1da6fdf8f12f19.tar.gz
minetest-faad6479defa30dec10cf4394c1da6fdf8f12f19.tar.bz2
minetest-faad6479defa30dec10cf4394c1da6fdf8f12f19.zip
Fix crash on revocation of removed privilege
Diffstat (limited to 'builtin/game')
-rw-r--r--builtin/game/register.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/game/register.lua b/builtin/game/register.lua
index e0073fc03..06c9c61d2 100644
--- a/builtin/game/register.lua
+++ b/builtin/game/register.lua
@@ -436,8 +436,9 @@ function core.run_callbacks(callbacks, mode, ...)
end
function core.run_priv_callbacks(name, priv, caller, method)
- if not core.registered_privileges[priv]["on_" .. method] or
- not core.registered_privileges[priv]["on_" .. method](name, caller) then
+ local def = core.registered_privileges[priv]
+ if not def or not def["on_" .. method] or
+ not def[priv]["on_" .. method](name, caller) then
for _, func in ipairs(core["registered_on_priv_" .. method]) do
if not func(name, caller, priv) then
break