Only remove the download immediately if there is no DCC receiver.
[xudocci.git] / 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. */