Skip to content

Commit 1ff1389

Browse files
fix(core): scoped factories should not fail with optional deps
1 parent 976cdf3 commit 1ff1389

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/core/injector/injector.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ export class Injector {
778778
inquirer?: InstanceWrapper,
779779
parentInquirer?: InstanceWrapper,
780780
): Promise<any[]> {
781-
const hosts = await Promise.all(
781+
const hosts: Array<InstanceWrapper<any> | undefined> = await Promise.all(
782782
metadata.map(async item =>
783783
this.resolveScopedComponentHost(
784784
item,
@@ -791,7 +791,7 @@ export class Injector {
791791
const inquirerId = this.getInquirerId(inquirer);
792792
return hosts.map(
793793
item =>
794-
item.getInstanceByContextId(
794+
item?.getInstanceByContextId(
795795
this.getContextId(contextId, item),
796796
inquirerId,
797797
).instance,

0 commit comments

Comments
 (0)