From bf8c15c5a857b8acfa22cdbc21595dfff41a1058 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Wed, 11 May 2022 14:46:02 +0200 Subject: [PATCH] MOBILE-3321 core: Fix optional dependency --- src/core/services/sites.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/services/sites.ts b/src/core/services/sites.ts index 642564033..d508b06b3 100644 --- a/src/core/services/sites.ts +++ b/src/core/services/sites.ts @@ -90,9 +90,9 @@ export class CoreSitesProvider { protected schemasTables: Record>> = {}; protected sitesTable = asyncInstance>(); - constructor(@Optional() @Inject(CORE_SITE_SCHEMAS) siteSchemas: CoreSiteSchema[][] = []) { + constructor(@Optional() @Inject(CORE_SITE_SCHEMAS) siteSchemas: CoreSiteSchema[][] | null) { this.logger = CoreLogger.getInstance('CoreSitesProvider'); - this.siteSchemas = CoreArray.flatten(siteSchemas).reduce( + this.siteSchemas = CoreArray.flatten(siteSchemas ?? []).reduce( (siteSchemas, schema) => { siteSchemas[schema.name] = schema;