Fixes Null Reference Exceptions with GenericTcpIpClient and GenericSshClient

This commit is contained in:
Neil Dorin
2017-12-19 09:51:05 -07:00
parent b94ebe082d
commit df9501f797
3 changed files with 12 additions and 6 deletions

View File

@@ -303,11 +303,16 @@ namespace PepperDash.Core
ReconnectTimer.Stop();
ReconnectTimer = null;
}
KillStream();
Client.Disconnect();
Client = null;
ClientStatus = SocketStatus.SOCKET_STATUS_BROKEN_LOCALLY;
Debug.Console(1, this, "Disconnected");
if (Client != null)
{
Client.Disconnect();
Client = null;
ClientStatus = SocketStatus.SOCKET_STATUS_BROKEN_LOCALLY;
Debug.Console(1, this, "Disconnected");
}
}
/// <summary>