From e328d82895add5417a48e63f3602931dcb1c701e Mon Sep 17 00:00:00 2001 From: KatKatKateryna Date: Wed, 26 Jun 2024 01:26:35 +0100 Subject: [PATCH] .NotNull will never return null, but cause Exception instead --- .../Bindings/BasicConnectorBinding.cs | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/BasicConnectorBinding.cs b/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/BasicConnectorBinding.cs index 649691a526..2ea13d82ff 100644 --- a/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/BasicConnectorBinding.cs +++ b/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/BasicConnectorBinding.cs @@ -71,20 +71,22 @@ public void HighlightModel(string modelCardId) var objectIds = new List(); - if (model is SenderModelCard senderModelCard) + try { - objectIds = senderModelCard.SendFilter.NotNull().GetObjectIds(); - } - - if (model is ReceiverModelCard receiverModelCard) - { - objectIds = receiverModelCard.BakedObjectIds.NotNull(); + if (model is SenderModelCard senderModelCard) + { + objectIds = senderModelCard.SendFilter.NotNull().GetObjectIds(); + } + else if (model is ReceiverModelCard receiverModelCard) + { + objectIds = receiverModelCard.BakedObjectIds.NotNull(); + } } - - if (objectIds is null) + catch (ArgumentNullException) { return; } + HighlightObjectsOnView(objectIds); }