fix(core): allow null / undefined values in query results (#35796)
Before this change ngIvy implementation of queries would throw upon encountering null / undefined query result collected from an embedded view. It turns out that we might have a provider that explicitly provides a null / undefined value in a place of a token queried for. This commit removes a check from the ngIvy query implementation that was asserting on a query result to be defined. Fixes #35673 PR Close #35796
This commit is contained in:
@ -363,9 +363,7 @@ function collectQueryResults<T>(tView: TView, lView: LView, queryIndex: number,
|
||||
for (let i = 0; i < tQueryMatches.length; i += 2) {
|
||||
const tNodeIdx = tQueryMatches[i];
|
||||
if (tNodeIdx > 0) {
|
||||
const viewResult = lViewResults[i / 2];
|
||||
ngDevMode && assertDefined(viewResult, 'materialized query result should be defined');
|
||||
result.push(viewResult as T);
|
||||
result.push(lViewResults[i / 2] as T);
|
||||
} else {
|
||||
const childQueryIndex = tQueryMatches[i + 1];
|
||||
|
||||
|
Reference in New Issue
Block a user