Skip to content

Commit

Permalink
fix nil index crash
Browse files Browse the repository at this point in the history
  • Loading branch information
BuckarooBanzay committed Oct 3, 2020
1 parent 60d3946 commit fbbca75
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ end

local old_set_privileges = minetest.builtin_auth_handler.set_privileges
function minetest.builtin_auth_handler.set_privileges(name, privileges)
cache[name].privileges = privileges
if cache[name] then
-- only set priv if the value is actually cached
-- prevents a weird crash if the auth-entry isn't cached yet or not anymore
cache[name].privileges = privileges
end
return old_set_privileges(name, privileges)
end

Expand Down

0 comments on commit fbbca75

Please sign in to comment.