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

Commit 60f6e6f

Browse files
zeunerClobberXD
authored andcommitted
Check if player exists before calling hud_remove (#1)
1 parent 0a7b952 commit 60f6e6f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

init.lua

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,12 @@ local function update()
6262
for name, hud in pairs(players) do
6363
if hud and os.time() > hud.time then
6464
local player = minetest.get_player_by_name(name)
65-
player:hud_remove(hud.bg)
66-
player:hud_remove(hud.msg)
67-
if not hide_sender then
68-
player:hud_remove(hud.header)
65+
if player then
66+
player:hud_remove(hud.bg)
67+
player:hud_remove(hud.msg)
68+
if not hide_sender then
69+
player:hud_remove(hud.header)
70+
end
6971
end
7072

7173
players[name] = nil

0 commit comments

Comments
 (0)