From d59756d8d7a43a0c12fa7ecec35955c9b1f40d8f Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 11 Apr 2013 21:53:11 +0200 Subject: [PATCH] Prevent NPE when socket could not be created. --- src/main/java/net/pterodactylus/irc/DccReceiver.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(); + } } } -- 2.7.4