mirror of https://github.com/quasar/Quasar.git
Minor null reference fix
This commit is contained in:
parent
1a13442c12
commit
76ca01a420
|
@ -30,8 +30,11 @@ public static void ForwardPort(ushort port)
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
// Placed in here to make sure that a failed TcpClient will never linger!
|
// Placed in here to make sure that a failed TcpClient will never linger!
|
||||||
|
if (c != null)
|
||||||
|
{
|
||||||
c.Close();
|
c.Close();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (endPoint != null)
|
if (endPoint != null)
|
||||||
{
|
{
|
||||||
|
@ -48,8 +51,9 @@ public static void ForwardPort(ushort port)
|
||||||
}
|
}
|
||||||
} while (retry < 5);
|
} while (retry < 5);
|
||||||
|
|
||||||
// As by the original UPnP, if we can't successfully connect (above),
|
if (string.IsNullOrEmpty(ipAddr)) // If we can't successfully connect
|
||||||
// shouldn't we just "return;"?
|
return;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IStaticPortMappingCollection portMap = new UPnPNAT().StaticPortMappingCollection;
|
IStaticPortMappingCollection portMap = new UPnPNAT().StaticPortMappingCollection;
|
||||||
|
|
Loading…
Reference in New Issue