Only remove the download immediately if there is no DCC receiver.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 20 Aug 2013 05:21:29 +0000 (07:21 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 20 Aug 2013 05:21:29 +0000 (07:21 +0200)
src/main/java/net/pterodactylus/xdcc/core/Core.java

index e78c4f1..fb3e61e 100644 (file)
@@ -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. */