mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
fix(devtools): check if node.children is undefined before trying to convert it into an array (ex. node is a text node)
This commit is contained in:
parent
a30d2a5653
commit
87aaa4933c
1 changed files with 3 additions and 2 deletions
|
|
@ -172,7 +172,7 @@ export class ComponentTreeObserver {
|
|||
if (component) {
|
||||
componentAccumulator.push(component);
|
||||
} else {
|
||||
Array.from(node.children).forEach(child =>
|
||||
Array.from(node.children || []).forEach(child =>
|
||||
this._getAllNestedComponentsWithinDomNode(child, componentAccumulator)
|
||||
);
|
||||
}
|
||||
|
|
@ -186,9 +186,10 @@ export class ComponentTreeObserver {
|
|||
directives = ng.getDirectives(node);
|
||||
} catch {}
|
||||
|
||||
Array.from(node.children).forEach(
|
||||
Array.from(node.children || []).forEach(
|
||||
child => (directives = directives.concat(this._getAllNestedDirectivesWithinDomNode(child)))
|
||||
);
|
||||
|
||||
return directives;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue