diff --git a/packages/core/src/render3/debug/framework_injector_profiler.ts b/packages/core/src/render3/debug/framework_injector_profiler.ts index 8efdfe247cd..bac185dffc6 100644 --- a/packages/core/src/render3/debug/framework_injector_profiler.ts +++ b/packages/core/src/render3/debug/framework_injector_profiler.ts @@ -207,11 +207,13 @@ function handleInstanceCreatedByInjectorEvent( // if our value is an instance of a standalone component, map the injector of that standalone // component to the component class. Otherwise, this event is a noop. - let standaloneComponent: Type | undefined = undefined; + let standaloneComponent: Type | undefined | null = undefined; if (typeof value === 'object') { - standaloneComponent = value?.constructor as Type; + standaloneComponent = value?.constructor as Type | undefined | null; } - if (standaloneComponent === undefined || !isStandaloneComponent(standaloneComponent)) { + + // We want to also cover if `standaloneComponent === null` in addition to `undefined` + if (standaloneComponent == undefined || !isStandaloneComponent(standaloneComponent)) { return; }