diff --git a/packages/core/src/render3/di.ts b/packages/core/src/render3/di.ts index 3cdbc6c6d4..a860087aeb 100644 --- a/packages/core/src/render3/di.ts +++ b/packages/core/src/render3/di.ts @@ -155,14 +155,13 @@ export function getOrCreateNodeInjectorForNode( } const parentLoc = getParentInjectorLocation(tNode, hostView); - const parentIndex = getParentInjectorIndex(parentLoc); - const parentLView = getParentInjectorView(parentLoc, hostView); - const injectorIndex = tNode.injectorIndex; // If a parent injector can't be found, its location is set to -1. // In that case, we don't need to set up a cumulative bloom if (hasParentInjector(parentLoc)) { + const parentIndex = getParentInjectorIndex(parentLoc); + const parentLView = getParentInjectorView(parentLoc, hostView); const parentData = parentLView[TVIEW].data as any; // Creates a cumulative bloom filter that merges the parent's bloom filter // and its own cumulative bloom (which contains tokens for all ancestors)