From 32b9a7aee864c8c4068e9b7de96493007860ace2 Mon Sep 17 00:00:00 2001 From: filoxenace Date: Mon, 6 Apr 2026 00:43:41 -0400 Subject: [PATCH] fix: add error handling for ApplyDescriptionResetAsync and nil-check Head --- src/convert.luau | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/convert.luau b/src/convert.luau index 0f4abe2..337ba04 100644 --- a/src/convert.luau +++ b/src/convert.luau @@ -50,11 +50,22 @@ function convert.convertCharacter(humanoid: Humanoid): () humDesc.Head = targetMesh humDesc.Face = face - humanoid:ApplyDescriptionResetAsync(humDesc) + + local ok, err = pcall(function() + humanoid:ApplyDescriptionResetAsync(humDesc) + end) + + if not ok then + warn(`rbx-reface: failed to apply description: {err}`) + return + end + -- VERY UGLY HACK: iBot head texture workaround if targetMesh == meshByName["iBot"] then - local head: MeshPart = humanoid.Parent:FindFirstChild("Head") - head.TextureID = "rbxassetid://97292285" + local head = humanoid.Parent:FindFirstChild("Head") + if head then + (head :: MeshPart).TextureID = "rbxassetid://97292285" + end end end