diff --git a/src/DataStreamSuite/PubSub/Client/Routing/PubSubRouter.cs b/src/DataStreamSuite/PubSub/Client/Routing/PubSubRouter.cs index 1f0c34bf9..0304c1411 100644 --- a/src/DataStreamSuite/PubSub/Client/Routing/PubSubRouter.cs +++ b/src/DataStreamSuite/PubSub/Client/Routing/PubSubRouter.cs @@ -48,7 +48,8 @@ namespace BCG { throw new ArgumentException($"Failed to find route for tag '{tag}'", nameof(tag)); } Log.Gen.info($"PubSubRouter.get_sub_url_for_tag tag: {tag} route: {route}"); - return RemoteConnectionInfo.parse_url(route.server_address); + ArgumentNullException.ThrowIfNull(route.ServerAddress); + return RemoteConnectionInfo.parse_url(route.ServerAddress); } public RemoteConnectionInfo get_sub_route_for_tag(string tag) { @@ -56,17 +57,18 @@ namespace BCG { throw new ArgumentException($"Failed to find route for tag '{tag}'", nameof(tag)); } Log.Gen.info($"PubSubRouter.get_sub_url_for_tag tag: {tag} route: {route}"); - return RemoteConnectionInfo.parse_url(route.server_address); + ArgumentNullException.ThrowIfNull(route.ServerAddress); + return RemoteConnectionInfo.parse_url(route.ServerAddress); } public List get_all_pubsub_sub_urls() => - _sub_routes.Select(r => r.server_address).ToList(); + _sub_routes.Select(r => r.ServerAddress ?? throw new InvalidOperationException("Route.ServerAddress is null")).ToList(); public List get_all_pubsub_pub_urlss() => - _pub_routes.Select(r => r.server_address).ToList(); + _pub_routes.Select(r => r.ServerAddress ?? throw new InvalidOperationException("Route.ServerAddress is null")).ToList(); - public event PubSubTagURLChangeDelegate onSubURLTagRouteChange; - public event PubSubTagURLChangeDelegate onPubURLTagRouteChange; + public event PubSubTagURLChangeDelegate? onSubURLTagRouteChange; + public event PubSubTagURLChangeDelegate? onPubURLTagRouteChange; #endregion @@ -77,7 +79,5 @@ namespace BCG { aVar = aVar + 2; } } - - } }