解决客户端空指针bug

This commit is contained in:
SpringHgui 2020-09-21 17:10:16 +08:00
parent bf8461a7d2
commit 54627a78cb

View File

@ -151,7 +151,7 @@ namespace FastTunnel.Core.Core
try
{
if (_client.Socket.Connected)
if (_client != null && _client.Socket.Connected)
{
_client.Socket.Shutdown(SocketShutdown.Both);
}
@ -162,7 +162,11 @@ namespace FastTunnel.Core.Core
}
finally
{
_client.Socket.Close();
if (_client != null)
{
_client.Socket.Close();
}
_logger.LogDebug("已退出登录\n");
}
}