From 05b53d1f30bf5bf52fc36a351a2a9b4619341b68 Mon Sep 17 00:00:00 2001 From: softworkz Date: Sat, 30 Jul 2016 05:58:15 +0200 Subject: Avoid frequent Exception --- MediaBrowser.Server.Implementations/Connect/ConnectManager.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Connect/ConnectManager.cs') diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs index 4e913cf99..45cb2f57d 100644 --- a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs +++ b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs @@ -65,12 +65,11 @@ namespace MediaBrowser.Server.Implementations.Connect if (!string.IsNullOrWhiteSpace(address)) { - try - { - address = new Uri(address).Host; - } - catch + Uri newUri; + + if (Uri.TryCreate(address, UriKind.Absolute, out newUri)) { + address = newUri.Host; } } -- cgit v1.2.3