aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsoftworkz <softworkz@hotmail.com>2016-07-30 05:58:15 +0200
committersoftworkz <softworkz@hotmail.com>2016-08-07 02:22:05 +0200
commit05b53d1f30bf5bf52fc36a351a2a9b4619341b68 (patch)
tree90ca0b9e2e602c5ca92fd4a6ef99c97d419b4847
parent894d87fabb812152c76443afcf1739fda7c578ff (diff)
Avoid frequent Exception
-rw-r--r--MediaBrowser.Server.Implementations/Connect/ConnectManager.cs9
1 files changed, 4 insertions, 5 deletions
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;
}
}