MOBILE-3321 core: Fix optional dependency

main
Noel De Martin 2022-05-11 14:46:02 +02:00
parent 2dbb620994
commit bf8c15c5a8
1 changed files with 2 additions and 2 deletions

View File

@ -90,9 +90,9 @@ export class CoreSitesProvider {
protected schemasTables: Record<string, AsyncInstance<CoreDatabaseTable<SchemaVersionsDBEntry, 'name'>>> = {};
protected sitesTable = asyncInstance<CoreDatabaseTable<SiteDBEntry>>();
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;