From a5bf6ea5746350d193f9fa5266ac9c248b8bd855 Mon Sep 17 00:00:00 2001 From: Hadi Eskandari Date: Mon, 31 Oct 2016 13:46:00 +1100 Subject: [PATCH] Fixes #613. --- .../ServiceControl/ServiceControlConnectionProvider.cs | 5 +++++ src/ServiceInsight/Shell/ShellViewModel.cs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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); }