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:
@@ -68,7 +68,10 @@ public class TwitchIRCClient extends Thread implements AutoCloseable
|
||||
{
|
||||
try
|
||||
{
|
||||
socket.close();
|
||||
if (socket != null)
|
||||
{
|
||||
socket.close();
|
||||
}
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user