fix: prevent crash when duplicating elements (#239)
- Guard _buildCache in merged-outline-node against stale/disposed Object3D refs that cause TypeError on .id access during render - Reset children array when duplicating roofs to prevent inconsistent parent-child relationships (matching existing stair behavior) - Use obj?.parent check in EditorOutlinerSync to ensure objects are still in the scene graph before adding to outliner arrays - Resume temporal state on parse failure to prevent undo/redo freeze Closes #232
This commit is contained in:
@@ -600,9 +600,14 @@ export class MergedOutlineNode extends TempNode {
|
||||
|
||||
private _buildCache(objects: Object3D[], cache: Set<Object3D>) {
|
||||
for (const obj of objects) {
|
||||
obj.traverse((child: any) => {
|
||||
if (child.isMesh || child.isSprite) cache.add(child)
|
||||
})
|
||||
if (!obj || !obj.traverse) continue
|
||||
try {
|
||||
obj.traverse((child: any) => {
|
||||
if (child.isMesh || child.isSprite) cache.add(child)
|
||||
})
|
||||
} catch {
|
||||
// Skip objects that were disposed or removed from the scene graph
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user