From: js6pak Date: Wed, 31 Mar 2021 11:39:15 +0000 (+0200) Subject: Fix warnings X-Git-Tag: 1.0.0~5 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=e4f106ab06edf72dababb323b3fdf1b37a9770f2;p=rhonda%2Fimpostor.hazel.git Fix warnings --- diff --git a/Hazel/NetworkConnection.cs b/Hazel/NetworkConnection.cs index 3b07174..3755a09 100644 --- a/Hazel/NetworkConnection.cs +++ b/Hazel/NetworkConnection.cs @@ -29,7 +29,9 @@ namespace Impostor.Hazel { if (IPMode == IPMode.IPv4) { +#pragma warning disable 618 return this.EndPoint.Address.Address; +#pragma warning restore 618 } else { diff --git a/Hazel/UPnP/UPnPHelper.cs b/Hazel/UPnP/UPnPHelper.cs index 5b44e0d..d44a7e4 100644 --- a/Hazel/UPnP/UPnPHelper.cs +++ b/Hazel/UPnP/UPnPHelper.cs @@ -281,7 +281,7 @@ namespace Impostor.Hazel.UPnP "", "DeletePortMapping"); return true; } - catch (Exception ex) + catch (Exception) { // m_peer.LogWarning("UPnP delete forwarding rule failed: " + ex.Message); return false; @@ -304,7 +304,7 @@ namespace Impostor.Hazel.UPnP string IP = xdoc.SelectSingleNode("//NewExternalIPAddress/text()", nsMgr).Value; return IPAddress.Parse(IP); } - catch (Exception ex) + catch (Exception) { // m_peer.LogWarning("Failed to get external IP: " + ex.Message); return null; @@ -344,4 +344,4 @@ $"{soap}" + this.socket.Dispose(); } } -} \ No newline at end of file +}