Bug Description
When rendering components in the Angular v0.9 renderer, a TypeError is thrown in the ComponentBinder service:
TypeError: Cannot read properties of null (reading 'componentId')
This occurs when a component defines its children (or other child properties) as null or undefined (for example, a container component that is rendered without any children).
Example JSON Payload (Triggering the bug)
Here is an example A2UI response payload that triggers this crash when the Angular renderer tries to bind properties for the Column component (because its children is null):
{
"version": "v0.9",
"updateComponents": {
"surfaceId": "main-surface",
"components": [
{
"id": "main-layout",
"component": "Column",
"children": null
}
]
}
}
Similarly, if children is omitted entirely from the component properties, also triggering a dereferencing crash on undefined:
{
"version": "v0.9",
"updateComponents": {
"surfaceId": "main-surface",
"components": [
{
"id": "main-layout",
"component": "Column"
}
]
}
}
Root Cause
In ComponentBinder.bind():
} else if (key === 'children') {
const originalSig = preactSig;
const id = value.componentId;
const path = value.path;
When the component does not have any children defined, the value of value (the children property) is null or undefined. Directly dereferencing value.componentId or value.path throws the TypeError.
Bug Description
When rendering components in the Angular v0.9 renderer, a
TypeErroris thrown in theComponentBinderservice:This occurs when a component defines its
children(or other child properties) as null or undefined (for example, a container component that is rendered without any children).Example JSON Payload (Triggering the bug)
Here is an example A2UI response payload that triggers this crash when the Angular renderer tries to bind properties for the
Columncomponent (because itschildrenis null):{ "version": "v0.9", "updateComponents": { "surfaceId": "main-surface", "components": [ { "id": "main-layout", "component": "Column", "children": null } ] } }Similarly, if
childrenis omitted entirely from the component properties, also triggering a dereferencing crash onundefined:{ "version": "v0.9", "updateComponents": { "surfaceId": "main-surface", "components": [ { "id": "main-layout", "component": "Column" } ] } }Root Cause
In
ComponentBinder.bind():When the component does not have any children defined, the value of
value(the children property) isnullorundefined. Directly dereferencingvalue.componentIdorvalue.paththrows theTypeError.