fix: prevent crash when duplicating elements#239
Merged
open-pascal merged 1 commit intopascalorg:mainfrom Apr 15, 2026
Merged
Conversation
- 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 pascalorg#232
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_buildCacheinmerged-outline-nodeagainst stale/disposed Object3D refs that causeTypeError: Cannot read properties of undefined (reading 'id')during WebGPU render passchildrenarray when duplicating roofs to prevent inconsistent parent-child relationships (matching existing stair duplication behavior)obj?.parentcheck inEditorOutlinerSyncto ensure objects removed from the scene graph don't reach the outline passtemporalstate on parse failure to prevent permanent undo/redo freezeCloses #232
Root cause
The crash occurs due to a race condition between the post-processing render pipeline and the outliner sync. When duplication modifies the scene, renderer components may unmount/remount, leaving stale
Object3Dreferences in the outliner arrays. TheMergedOutlineNode._buildCache()then calls.traverse()on these stale refs, and the WebGPU pipeline crashes accessing.idon disposed internals.Test plan