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:
@@ -67,9 +67,12 @@ public class TwitchIRCClient extends Thread implements AutoCloseable
|
|||||||
public void close()
|
public void close()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
{
|
||||||
|
if (socket != null)
|
||||||
{
|
{
|
||||||
socket.close();
|
socket.close();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch (IOException ex)
|
catch (IOException ex)
|
||||||
{
|
{
|
||||||
log.warn("error closing socket", ex);
|
log.warn("error closing socket", ex);
|
||||||
|
|||||||
Reference in New Issue
Block a user