From: David ‘Bombe’ Roden Date: Thu, 11 Apr 2013 19:53:11 +0000 (+0200) Subject: Prevent NPE when socket could not be created. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=d59756d8d7a43a0c12fa7ecec35955c9b1f40d8f;p=xudocci.git Prevent NPE when socket could not be created. --- diff --git a/src/main/java/net/pterodactylus/irc/DccReceiver.java b/src/main/java/net/pterodactylus/irc/DccReceiver.java index 56a3853..9616deb 100644 --- a/src/main/java/net/pterodactylus/irc/DccReceiver.java +++ b/src/main/java/net/pterodactylus/irc/DccReceiver.java @@ -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(); + } } }