From 4d2b62e4a1113d052941675695216470769885a0 Mon Sep 17 00:00:00 2001 From: ZioPao Date: Wed, 21 Aug 2024 01:55:59 +0200 Subject: [PATCH] Error check for OnProsthesisEquipped --- media/lua/client/TOC/Handlers/ProsthesisHandler.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/media/lua/client/TOC/Handlers/ProsthesisHandler.lua b/media/lua/client/TOC/Handlers/ProsthesisHandler.lua index edd1f23..b4f84e8 100644 --- a/media/lua/client/TOC/Handlers/ProsthesisHandler.lua +++ b/media/lua/client/TOC/Handlers/ProsthesisHandler.lua @@ -168,7 +168,11 @@ function ISUnequipAction:perform() local highestAmputatedLimbs = CachedDataHandler.GetHighestAmputatedLimbs(getPlayer():getUsername()) if highestAmputatedLimbs then local hal = highestAmputatedLimbs[side] - triggerEvent("OnProsthesisUnequipped", hal) + if hal then + -- This could break if amputated limbs aren't cached for some reason + triggerEvent("OnProsthesisUnequipped", hal) + end + end end end