twitch: fix npe closing client if no socket has been created

If the client is closed prior to the socket being created, or if socket creation fails, this will repeatedly throw out of close() in connect() and is never able to reestablish a connection
This commit is contained in:
Adam
2020-12-09 19:16:49 -05:00
parent 807a22172f
commit c2d5165709

View File

@@ -68,7 +68,10 @@ public class TwitchIRCClient extends Thread implements AutoCloseable
{
try
{
socket.close();
if (socket != null)
{
socket.close();
}
}
catch (IOException ex)
{