Skip to content
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.

Commit

Permalink
Check if player exists before calling hud_remove (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeuner authored and ClobberXD committed Dec 20, 2018
1 parent 0a7b952 commit 60f6e6f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ local function update()
for name, hud in pairs(players) do
if hud and os.time() > hud.time then
local player = minetest.get_player_by_name(name)
player:hud_remove(hud.bg)
player:hud_remove(hud.msg)
if not hide_sender then
player:hud_remove(hud.header)
if player then
player:hud_remove(hud.bg)
player:hud_remove(hud.msg)
if not hide_sender then
player:hud_remove(hud.header)
end
end

players[name] = nil
Expand Down

0 comments on commit 60f6e6f

Please sign in to comment.