Prevent NPE on closing.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 5 Aug 2013 17:16:14 +0000 (19:16 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 8 Aug 2013 00:15:59 +0000 (02:15 +0200)
src/main/java/net/pterodactylus/irc/Connection.java

index ec063f6..f48b205 100644 (file)
@@ -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();
+               }
        }
 
        //