Skip to content

Commit ea7cdf8

Browse files
committed
f
1 parent a405a02 commit ea7cdf8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/elements/src/component-factory-strategy.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ export class ComponentNgElementStrategy implements NgElementStrategy {
172172
const hostView = this.componentRef!.hostView as EmbeddedViewRef<unknown>;
173173
const viewNode = hostView?.rootNodes?.[0] as HTMLElement;
174174
const parent = viewNode?.parentElement!;
175+
if (!parent) {
176+
return;
177+
}
175178
const index = parent && Array.from(parent.childNodes).indexOf(viewNode);
176179
const beforeOf = parent && parent.childNodes.item(index + 1);
177180
return {parent, viewNode, beforeOf};

0 commit comments

Comments
 (0)