From 5ecf600fdacb4eaf4a33f97ebe52dd1c5461b696 Mon Sep 17 00:00:00 2001 From: Lars Mueller Date: Thu, 19 May 2022 10:19:14 +0200 Subject: [PATCH] Fix crash for invalid player object --- init.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 0808ae1..dc67fe0 100644 --- a/init.lua +++ b/init.lua @@ -179,7 +179,13 @@ local function normalize_rotation(euler_rotation) end function handle_player_animations(dtime, player) - local mesh = player:get_properties().mesh + local props = player:get_properties() + if not props then + -- HACK inside on_joinplayer, the player object may be invalid + -- causing get_properties() to return nothing - just ignore this + return + end + local mesh = props.mesh local model = models[mesh] if not model then return