From 53bbea2c3dcdba5d4a66800cccd8c320d8548a69 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 5 Aug 2013 19:16:14 +0200 Subject: [PATCH] Prevent NPE on closing. --- src/main/java/net/pterodactylus/irc/Connection.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/pterodactylus/irc/Connection.java b/src/main/java/net/pterodactylus/irc/Connection.java index ec063f6..f48b205 100644 --- a/src/main/java/net/pterodactylus/irc/Connection.java +++ b/src/main/java/net/pterodactylus/irc/Connection.java @@ -325,7 +325,9 @@ public class Connection extends AbstractExecutionThreadService implements Servic * if an I/O error occurs */ public void close() throws IOException { - connectionHandler.close(); + if (connectionHandler != null) { + connectionHandler.close(); + } } // -- 2.7.4