Commit 1256331
authored
fix(editor): guard onShelfMove against null cursorGroupRef (pascalorg#342)
Adds the missing `if (!cursorGroupRef.current) return` guard to onShelfMove. mitt listeners are registered for the tool's whole lifetime, so a shelf event can fire before the cursor group mounts or after teardown, leaving the ref null and throwing on `cursorGroupRef.current.rotation.y`.
Partial fix for the EDITOR-BC family: the other placement handlers (onGridMove/onWallMove/onItemMove/onCeilingMove and the keyboard/cancel paths) share the same null-ref exposure and still need the broader, correctly-scoped guard — tracked separately (PR pascalorg#323 attempts this but needs rework).1 parent c986ced commit 1256331
1 file changed
Lines changed: 3 additions & 0 deletions
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1147 | 1147 | | |
1148 | 1148 | | |
1149 | 1149 | | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
1150 | 1153 | | |
1151 | 1154 | | |
1152 | 1155 | | |
| |||
0 commit comments