Prevent NPE on closing.
[xudocci.git] / 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();
+               }
        }
 
        //