Skip to content

Commit

Permalink
Fix crash on revocation of removed privilege
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenwardy committed Sep 8, 2017
1 parent 745a90d commit faad647
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions builtin/game/register.lua
Expand Up @@ -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
Expand Down

0 comments on commit faad647

Please sign in to comment.