From c2d5165709352c492499676a41e19c02bba47380 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 9 Dec 2020 19:16:49 -0500 Subject: [PATCH] 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 --- .../runelite/client/plugins/twitch/irc/TwitchIRCClient.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/twitch/irc/TwitchIRCClient.java b/runelite-client/src/main/java/net/runelite/client/plugins/twitch/irc/TwitchIRCClient.java index 2361dd2e97..53f8d461e4 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/twitch/irc/TwitchIRCClient.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/twitch/irc/TwitchIRCClient.java @@ -68,7 +68,10 @@ public class TwitchIRCClient extends Thread implements AutoCloseable { try { - socket.close(); + if (socket != null) + { + socket.close(); + } } catch (IOException ex) {