X-Git-Url: https://git.pterodactylus.net/?p=xudocci.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fxdcc%2Fcore%2FCore.java;h=24727d9c390c9814c672bb263ef61fca64e6f3b5;hp=5b1b12d865893e29636c6ed0a32ecd3f222ca72b;hb=d5e7222794392ab7c75a27afea6b6a6ce0bcdba5;hpb=4df55ce548d957450159555f04f6b79c08a9fb69 diff --git a/src/main/java/net/pterodactylus/xdcc/core/Core.java b/src/main/java/net/pterodactylus/xdcc/core/Core.java index 5b1b12d..24727d9 100644 --- a/src/main/java/net/pterodactylus/xdcc/core/Core.java +++ b/src/main/java/net/pterodactylus/xdcc/core/Core.java @@ -339,13 +339,6 @@ public class Core extends AbstractExecutionThreadService { return; } - /* get connection. */ - Connection connection = networkConnections.get(bot.network()); - if (connection == null) { - /* request for unknown network? */ - return; - } - /* stop the DCC receiver. */ if (download.get().dccReceiver() != null) { download.get().dccReceiver().stop(); @@ -354,6 +347,13 @@ public class Core extends AbstractExecutionThreadService { downloads.remove(pack.name(), download.get()); } + /* get connection. */ + Connection connection = networkConnections.get(bot.network()); + if (connection == null) { + /* request for unknown network? */ + return; + } + /* remove the request from the bot, too. */ try { connection.sendMessage(bot.name(), String.format("XDCC %s", (download.get().dccReceiver() != null) ? "CANCEL" : "REMOVE"));