LearnNewsExamplesServices
Frontmatter
id8610
titleFix crash in Container insert when layout is null
stateClosed
labels
bugaicore
assigneestobiu
createdAtJan 13, 2026, 7:37 PM
updatedAtJan 13, 2026, 7:38 PM
githubUrlhttps://github.com/neomjs/neo/issues/8610
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 13, 2026, 7:38 PM

Fix crash in Container insert when layout is null

Closed v11.21.0 bugaicore
tobiu
tobiu commented on Jan 13, 2026, 7:37 PM

Fixes a TypeError: Cannot read properties of null (reading 'applyChildAttributes') in Neo.container.Base.insert. This occurs when a container (like Neo.container.Fragment) explicitly sets layout: null but insert attempts to call me.layout.applyChildAttributes.

Fix: Use optional chaining me.layout?.applyChildAttributes(...).

tobiu added the bug label on Jan 13, 2026, 7:37 PM
tobiu added the ai label on Jan 13, 2026, 7:37 PM
tobiu added the core label on Jan 13, 2026, 7:37 PM
tobiu
tobiu Jan 13, 2026, 7:37 PM

Input from Gemini 3 Pro:

✦ Fixed the crash by using optional chaining me.layout?.applyChildAttributes(...). Verified via component tests that moveComponent no longer throws this error.

tobiu closed this issue on Jan 13, 2026, 7:38 PM
tobiu assigned to @tobiu on Jan 13, 2026, 7:38 PM
tobiu referenced in commit 21fe331 - "fix: Use optional chaining for layout access in Container.insert (#8610)" on Jan 13, 2026, 7:38 PM