From baaf932d004318ae89d323bc0d6833e32ca535d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CIsaac?= Date: Mon, 3 Nov 2025 10:35:43 +1000 Subject: [PATCH] fix: error in JointsExample due to ref usage --- demo/src/examples/joints/JointsExample.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/demo/src/examples/joints/JointsExample.tsx b/demo/src/examples/joints/JointsExample.tsx index 1692b860..1e593bb6 100644 --- a/demo/src/examples/joints/JointsExample.tsx +++ b/demo/src/examples/joints/JointsExample.tsx @@ -59,9 +59,12 @@ const Rope = (props: { component: ReactNode; length: number }) => { useFrame(() => { const now = performance.now(); - refs.current[0].current!.setNextKinematicRotation( - new Quaternion(0, Math.sin(now / 500) * 3, 0) - ); + const ref = refs.current[0].current; + if (ref) { + ref.setNextKinematicRotation( + new Quaternion(0, Math.sin(now / 500) * 3, 0) + ); + } }); return (