From ed92fd37eab5a0f834255eb4f363b5d603cbc15e Mon Sep 17 00:00:00 2001 From: "Micael Levi L. Cavalcante" Date: Fri, 6 Oct 2023 11:37:18 -0400 Subject: [PATCH] fix(core): when the discoverable decorator is not used --- packages/core/discovery/discoverable-meta-host-collection.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/discovery/discoverable-meta-host-collection.ts b/packages/core/discovery/discoverable-meta-host-collection.ts index c0642b278da..fd5c79dfaae 100644 --- a/packages/core/discovery/discoverable-meta-host-collection.ts +++ b/packages/core/discovery/discoverable-meta-host-collection.ts @@ -94,7 +94,7 @@ export class DiscoverableMetaHostCollection { metaKey: string, ): Set { const wrappersByMetaKey = this.providersByMetaKey.get(hostContainerRef); - return wrappersByMetaKey.get(metaKey); + return wrappersByMetaKey?.get(metaKey) ?? new Set(); } public static getControllersByMetaKey( @@ -102,7 +102,7 @@ export class DiscoverableMetaHostCollection { metaKey: string, ): Set { const wrappersByMetaKey = this.controllersByMetaKey.get(hostContainerRef); - return wrappersByMetaKey.get(metaKey); + return wrappersByMetaKey?.get(metaKey) ?? new Set(); } private static inspectInstanceWrapper(