Skip to content

fix(nodes): coalesce node.children to [] in renderers (Sentry EDITOR-C0)#333

Open
anton-pascal wants to merge 1 commit into
mainfrom
fix/sentry-EDITOR-C0
Open

fix(nodes): coalesce node.children to [] in renderers (Sentry EDITOR-C0)#333
anton-pascal wants to merge 1 commit into
mainfrom
fix/sentry-EDITOR-C0

Conversation

@anton-pascal
Copy link
Copy Markdown
Contributor

Summary

CeilingRenderer crashes in production with:

TypeError: Cannot read properties of undefined (reading 'map')

…because node.children is undefined for ceiling nodes loaded from older serialized data that predates the children field. Same shape can affect other container renderers.

packages/nodes/src/roof/renderer.tsx already uses node.children ?? [] for exactly this reason. This PR applies the same guard to the remaining renderers that iterate node.children directly.

Affected renderers

  • packages/nodes/src/ceiling/renderer.tsx (the one that triggered Sentry EDITOR-C0)
  • packages/nodes/src/wall/renderer.tsx
  • packages/nodes/src/site/renderer.tsx
  • packages/nodes/src/building/renderer.tsx

roof/renderer.tsx already had the guard — left untouched.

Change

One-liner per file:

- {node.children.map((childId) => (
+ {(node.children ?? []).map((childId) => (

No behaviour change for properly-shaped nodes; only prevents the crash on legacy/partial node data.

Sentry

CeilingRenderer crashed with `Cannot read properties of undefined (reading 'map')`
on production /editor/:projectId because node.children was undefined for ceilings
loaded from older serialized data that predates the children field.

Apply the same `?? []` guard already used in roof/renderer.tsx to
ceiling, wall, site, building renderers — defensive, no behaviour
change for properly-shaped nodes.
@mintlify
Copy link
Copy Markdown

mintlify Bot commented May 24, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
pascal 🔴 Failed May 24, 2026, 4:05 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant