From: David ‘Bombe’ Roden Date: Tue, 20 Aug 2013 05:21:29 +0000 (+0200) Subject: Only remove the download immediately if there is no DCC receiver. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=58dbc9b92a90eb17fecaf12d9ef070bce621ebdb;p=xudocci.git Only remove the download immediately if there is no DCC receiver. --- diff --git a/src/main/java/net/pterodactylus/xdcc/core/Core.java b/src/main/java/net/pterodactylus/xdcc/core/Core.java index e78c4f1..fb3e61e 100644 --- a/src/main/java/net/pterodactylus/xdcc/core/Core.java +++ b/src/main/java/net/pterodactylus/xdcc/core/Core.java @@ -281,12 +281,12 @@ public class Core extends AbstractExecutionThreadService { return; } - /* remove download. */ - downloads.remove(pack.name(), download.get()); - /* stop the DCC receiver. */ if (download.get().dccReceiver() != null) { download.get().dccReceiver().stop(); + } else { + /* remove download if it hasn’t started yet. */ + downloads.remove(pack.name(), download.get()); } /* remove the request from the bot, too. */