From fbaabd4c2092750adbede0f3085789afdd348c46 Mon Sep 17 00:00:00 2001 From: Thomas Hilzendegen Date: Tue, 7 Nov 2023 14:19:59 +0100 Subject: [PATCH] fix(connector): handle null targets --- .../RelayConnectorOptions.cs | 2 +- .../Options/RelayConnectorConfigureOptions.cs | 2 +- .../Options/RelayConnectorPostConfigureOptions.cs | 2 +- .../Options/RelayConnectorValidateOptions.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Thinktecture.Relay.Connector.Abstractions/RelayConnectorOptions.cs b/src/Thinktecture.Relay.Connector.Abstractions/RelayConnectorOptions.cs index 6b7a7cdbb..764b493cf 100644 --- a/src/Thinktecture.Relay.Connector.Abstractions/RelayConnectorOptions.cs +++ b/src/Thinktecture.Relay.Connector.Abstractions/RelayConnectorOptions.cs @@ -37,5 +37,5 @@ public class RelayConnectorOptions /// /// The targets keyed by id. /// - public Dictionary> Targets { get; set; } = default!; + public Dictionary>? Targets { get; set; } } diff --git a/src/Thinktecture.Relay.Connector/Options/RelayConnectorConfigureOptions.cs b/src/Thinktecture.Relay.Connector/Options/RelayConnectorConfigureOptions.cs index 29c31e102..fafb7d1bb 100644 --- a/src/Thinktecture.Relay.Connector/Options/RelayConnectorConfigureOptions.cs +++ b/src/Thinktecture.Relay.Connector/Options/RelayConnectorConfigureOptions.cs @@ -7,7 +7,7 @@ internal class RelayConnectorConfigureOptions : IConfigureOptions 0) + if (options.Targets != null) { RegisterTargets(options.Targets); } diff --git a/src/Thinktecture.Relay.Connector/Options/RelayConnectorValidateOptions.cs b/src/Thinktecture.Relay.Connector/Options/RelayConnectorValidateOptions.cs index 980b00954..c095b1819 100644 --- a/src/Thinktecture.Relay.Connector/Options/RelayConnectorValidateOptions.cs +++ b/src/Thinktecture.Relay.Connector/Options/RelayConnectorValidateOptions.cs @@ -8,7 +8,7 @@ internal class RelayConnectorValidateOptions : IValidateOptions !kvp.Value.ContainsKey(Constants.RelayConnectorOptionsTargetType)) .Select(kvp => kvp.Key).ToArray();