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;