diff --git a/src/ServiceInsight/ServiceControl/ServiceControlConnectionProvider.cs b/src/ServiceInsight/ServiceControl/ServiceControlConnectionProvider.cs index f1d6b706..650cf1ac 100644 --- a/src/ServiceInsight/ServiceControl/ServiceControlConnectionProvider.cs +++ b/src/ServiceInsight/ServiceControl/ServiceControlConnectionProvider.cs @@ -15,6 +15,11 @@ public void ConnectTo(string url) { Url = url; + if (url == null) + { + return; + } + AsyncPump.Run(async () => { await serviceControl.ClearServiceControls(); diff --git a/src/ServiceInsight/Shell/ShellViewModel.cs b/src/ServiceInsight/Shell/ShellViewModel.cs index debe15a4..eee9b7ef 100644 --- a/src/ServiceInsight/Shell/ShellViewModel.cs +++ b/src/ServiceInsight/Shell/ShellViewModel.cs @@ -169,7 +169,7 @@ protected override void OnInitialize() using (workNotifer.NotifyOfWork("Trying to connect to ServiceControl")) { connectionProvider.ConnectTo(configuredConnection); - if (!serviceControl.IsAlive()) + if (!serviceControl.IsAlive() && existingConnection != null) { connectionProvider.ConnectTo(existingConnection); }