From: David ‘Bombe’ Roden Date: Fri, 9 Aug 2013 14:06:05 +0000 (+0200) Subject: Fix cancelling downloads. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=4b537b2d4a5b2aec431e0faeb801cc62a741a465;p=xudocci.git Fix cancelling downloads. --- diff --git a/src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java b/src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java index c78697a..c278ea5 100644 --- a/src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java +++ b/src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java @@ -160,8 +160,8 @@ public class CommandReader extends AbstractExecutionThreadService { } } else if (words[0].equalsIgnoreCase("cancel")) { Integer index = Ints.tryParse(words[1]); - if ((index != null) && (index < lastResult.size())) { - core.cancelDownload(lastResult.get(index).bot(), lastResult.get(index).pack()); + if ((index != null) && (index < downloads.size())) { + core.cancelDownload(downloads.get(index).bot(), downloads.get(index).pack()); } } else if (words[0].equalsIgnoreCase("stats")) { int configuredChannelsCount = core.channels().size();