mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08: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:
committed by
Minko Gechev
parent
a30d2a5653
commit
87aaa4933c
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user