From 1076d5a65357102d0fcd99f35ae2303a1993e9ba Mon Sep 17 00:00:00 2001 From: openclaw-agent Date: Thu, 4 Jun 2026 04:10:04 +0000 Subject: [PATCH] fix(wall-tool): null-guard wallPreviewRef writes in onGridClick / onGridMove Sentry MONOREPO-EDITOR-D0: when the wall tool unmounts mid-click (level switch / tool change), the emitter listener can fire after the mesh is removed from R3F, leaving wallPreviewRef.current null. Match the guard style at line 407. --- packages/nodes/src/wall/tool.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes/src/wall/tool.tsx b/packages/nodes/src/wall/tool.tsx index 530472ec1..7b2e0c9c6 100644 --- a/packages/nodes/src/wall/tool.tsx +++ b/packages/nodes/src/wall/tool.tsx @@ -542,7 +542,7 @@ export const WallTool: React.FC = () => { // BoxGeometry stays visible for a frame on top of the // freshly-committed real wall, producing a brief // double-paint at the new wall's position. - wallPreviewRef.current.visible = false + if (wallPreviewRef.current) wallPreviewRef.current.visible = false setDraftMeasurement(null) } }