From 0b26e021cde48d85e36eefd260eeaa0c277d1099 Mon Sep 17 00:00:00 2001 From: Dimitrie Stefanescu Date: Mon, 10 Feb 2025 17:33:42 +0000 Subject: [PATCH] fix: prevents fatal crash on old model cards (#548) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: prevents fatal crash on old model cards * fix: formatting --------- Co-authored-by: Claire Kuang Co-authored-by: Oğuzhan Koral <45078678+oguzhankoral@users.noreply.github.com> --- .../Bindings/RevitSendBinding.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitSendBinding.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitSendBinding.cs index 9bed15de4..ca9e265fa 100644 --- a/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitSendBinding.cs +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitSendBinding.cs @@ -399,6 +399,11 @@ internal sealed class RevitSendBinding : RevitBaseBinding, ISendBinding viewFilter.SetContext(_revitContext); } + if (modelCard.SendFilter is null || modelCard.SendFilter.IdMap is null) + { + continue; + } + var selectedObjects = modelCard.SendFilter.NotNull().IdMap.NotNull().Values; var intersection = selectedObjects.Intersect(objUniqueIds).ToList(); bool isExpired = intersection.Count != 0;