From a21b92d1b1285feaf5a69e30331cb0ec3d0a27a6 Mon Sep 17 00:00:00 2001 From: KatKatKateryna Date: Tue, 28 May 2024 23:24:12 +0100 Subject: [PATCH] prevent ArcGIS crash on open (if project contained layers with non-existent data sources) --- .../Bindings/ArcGISSendBinding.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISSendBinding.cs b/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISSendBinding.cs index 9f883384c3..79cd0b1c1a 100644 --- a/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISSendBinding.cs +++ b/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISSendBinding.cs @@ -104,8 +104,11 @@ private void SubscribeToFeatureLayerDataSourceChange(FeatureLayer layer) return; } Table layerTable = layer.GetTable(); - SubscribeToAnyDataSourceChange(layerTable); - SubscribedLayers.Add(layer); + if (layerTable != null) + { + SubscribeToAnyDataSourceChange(layerTable); + SubscribedLayers.Add(layer); + } } private void SubscribeToTableDataSourceChange(StandaloneTable table) @@ -115,8 +118,11 @@ private void SubscribeToTableDataSourceChange(StandaloneTable table) return; } Table layerTable = table.GetTable(); - SubscribeToAnyDataSourceChange(layerTable); - SubscribedTables.Add(table); + if (layerTable != null) + { + SubscribeToAnyDataSourceChange(layerTable); + SubscribedTables.Add(table); + } } private void SubscribeToAnyDataSourceChange(Table layerTable)