From 1a43082c4afbcb0b807d1b2273f9a783eb56093c Mon Sep 17 00:00:00 2001 From: Luc Genetier <69138830+LucGenetier@users.noreply.github.com> Date: Mon, 13 Jan 2025 19:12:40 +0100 Subject: [PATCH] Avoid NullRef in CdpDelegationInfo (#2814) --- .../Tabular/Capabilities/ServiceCapabilities.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/Microsoft.PowerFx.Connectors/Tabular/Capabilities/ServiceCapabilities.cs b/src/libraries/Microsoft.PowerFx.Connectors/Tabular/Capabilities/ServiceCapabilities.cs index 02d35ad4c0..d793165466 100644 --- a/src/libraries/Microsoft.PowerFx.Connectors/Tabular/Capabilities/ServiceCapabilities.cs +++ b/src/libraries/Microsoft.PowerFx.Connectors/Tabular/Capabilities/ServiceCapabilities.cs @@ -176,7 +176,7 @@ public static TableDelegationInfo ToDelegationInfo(ServiceCapabilities serviceCa }) as Core.Entities.ColumnCapabilitiesBase, ComplexColumnCapabilities ccc => new Core.Entities.ComplexColumnCapabilities() as Core.Entities.ColumnCapabilitiesBase, _ => throw new NotImplementedException() - }); + }) ?? new Dictionary(); Dictionary columnWithRelationships = connectorType.Fields.Where(f => f.ExternalTables?.Any() == true).Select(f => (f.Name, f.ExternalTables.First())).ToDictionary(tpl => tpl.Name, tpl => tpl.Item2); string[] primaryKeyNames = connectorType.Fields.Where(f => f.KeyType == ConnectorKeyType.Primary).OrderBy(f => f.KeyOrder).Select(f => f.Name).ToArray();