From 60f6e6f3d0876b680c3d098e67592f3c553e15ef Mon Sep 17 00:00:00 2001 From: zeuner Date: Thu, 20 Dec 2018 11:53:52 +0100 Subject: [PATCH] Check if player exists before calling hud_remove (#1) --- init.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 2c8f319..8022229 100644 --- a/init.lua +++ b/init.lua @@ -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