diff --git a/packages/editor/src/components/tools/item/use-placement-coordinator.tsx b/packages/editor/src/components/tools/item/use-placement-coordinator.tsx index 8edc1207d..192425502 100644 --- a/packages/editor/src/components/tools/item/use-placement-coordinator.tsx +++ b/packages/editor/src/components/tools/item/use-placement-coordinator.tsx @@ -1252,6 +1252,13 @@ export function usePlacementCoordinator(config: PlacementCoordinatorConfig): Rea const onShelfMove = (event: ShelfEvent) => { has3DPointerDrivenMoveRef.current = true + // Guard against null ref. The mitt event listener can fire after the + // component unmounts (or before the attaches), and the + // unguarded `cursorGroupRef.current.rotation.y = ...` write below was + // the source of EDITOR-BC (`Cannot read properties of null (reading + // 'rotation')`) — 53k+ events. Every other surface-move handler in + // this file already has this guard; onShelfMove was missed in #323. + if (!cursorGroupRef.current) return const ctx = getContext() if (ctx.state.surface !== 'shelf-surface') { // Cursor entered via a move event without an enter — try