From 6cc80d0603480cd80f0e06681b19879bb969ae6f Mon Sep 17 00:00:00 2001 From: LoneWolfHT Date: Tue, 23 Apr 2024 12:45:21 -0700 Subject: [PATCH] Fix crash --- builtin/game/hud.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/game/hud.lua b/builtin/game/hud.lua index 4d531215d..dc7101caa 100644 --- a/builtin/game/hud.lua +++ b/builtin/game/hud.lua @@ -224,9 +224,9 @@ register_builtin_hud_element("breath", { -- The breathbar stays for some time and then gets removed. breathbar_removal_jobs[player_name] = core.after(1, function() local player = core.get_player_by_name(player_name) - local id = hud_ids[player_name].breath - if player and id then - player:hud_remove(id) + local id = hud_ids[player_name] + if player and id and id.breath then + player:hud_remove(id.breath) hud_ids[player_name].breath = nil end breathbar_removal_jobs[player_name] = nil