From e4f106ab06edf72dababb323b3fdf1b37a9770f2 Mon Sep 17 00:00:00 2001 From: js6pak Date: Wed, 31 Mar 2021 13:39:15 +0200 Subject: [PATCH] Fix warnings --- Hazel/NetworkConnection.cs | 2 ++ Hazel/UPnP/UPnPHelper.cs | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) 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 +} -- 2.39.5