From ece5223f24bb74c175ee8bc60f69bd5da0929f86 Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Sun, 10 Jan 2021 01:39:51 +0100 Subject: [PATCH] Fix potential crash --- init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 0da5e5a..ab79a7e 100644 --- a/init.lua +++ b/init.lua @@ -2333,8 +2333,9 @@ end) core.register_on_player_hpchange(function(player, hpchange) local name = player:get_player_name() local data = pdata[name] - local hp_max = player:get_properties().hp_max + if not data then return end + local hp_max = player:get_properties().hp_max data.hp = min(hp_max, player:get_hp() + hpchange) set_fs(player)