From a97066da4d95b4cbbc0e306b5d4173e18d584765 Mon Sep 17 00:00:00 2001 From: Matteo Cominetti Date: Mon, 18 Sep 2023 08:08:54 +0100 Subject: [PATCH] fix(revit): type mapping null reference (#2926) --- ConnectorRevit/ConnectorRevit/TypeMapping/ElementTypeMapper.cs | 2 +- ConnectorRevit/ConnectorRevit/TypeMapping/FamilyImporter.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ConnectorRevit/ConnectorRevit/TypeMapping/ElementTypeMapper.cs b/ConnectorRevit/ConnectorRevit/TypeMapping/ElementTypeMapper.cs index 0f7467e700..90360074fe 100644 --- a/ConnectorRevit/ConnectorRevit/TypeMapping/ElementTypeMapper.cs +++ b/ConnectorRevit/ConnectorRevit/TypeMapping/ElementTypeMapper.cs @@ -162,7 +162,7 @@ await Dispatcher.UIThread.InvokeAsync(() => { try { - familyImporter ??= new FamilyImporter(document, revitCategoriesExposer, typeRetriever); + familyImporter ??= new FamilyImporter(document, revitCategoriesExposer, typeRetriever, revitDocumentAggregateCache); await familyImporter.ImportFamilyTypes(hostTypesContainer).ConfigureAwait(false); } catch (SpeckleException ex) diff --git a/ConnectorRevit/ConnectorRevit/TypeMapping/FamilyImporter.cs b/ConnectorRevit/ConnectorRevit/TypeMapping/FamilyImporter.cs index c253a1d602..d339077d30 100644 --- a/ConnectorRevit/ConnectorRevit/TypeMapping/FamilyImporter.cs +++ b/ConnectorRevit/ConnectorRevit/TypeMapping/FamilyImporter.cs @@ -25,11 +25,12 @@ internal sealed class FamilyImporter private readonly IRevitElementTypeRetriever typeRetriever; private readonly IRevitDocumentAggregateCache revitDocumentAggregateCache; - public FamilyImporter(Document document, IAllRevitCategoriesExposer revitCategoriesExposer, IRevitElementTypeRetriever typeRetriever) + public FamilyImporter(Document document, IAllRevitCategoriesExposer revitCategoriesExposer, IRevitElementTypeRetriever typeRetriever, IRevitDocumentAggregateCache revitDocumentAggregateCache) { this.document = document; this.revitCategoriesExposer = revitCategoriesExposer; this.typeRetriever = typeRetriever; + this.revitDocumentAggregateCache = revitDocumentAggregateCache; } ///