Prevent NPE when socket could not be created.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 11 Apr 2013 19:53:11 +0000 (21:53 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 11 Apr 2013 19:53:11 +0000 (21:53 +0200)
src/main/java/net/pterodactylus/irc/DccReceiver.java

index 56a3853..9616deb 100644 (file)
@@ -173,7 +173,9 @@ public class DccReceiver extends AbstractExecutionThreadService {
                        eventBus.post(new DccDownloadFailed(this, ioe1));
                } finally {
                        Closeables.close(inputStream, true);
-                       socket.close();
+                       if (socket != null) {
+                               socket.close();
+                       }
                }
        }