From 4b537b2d4a5b2aec431e0faeb801cc62a741a465 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 9 Aug 2013 16:06:05 +0200 Subject: [PATCH] Fix cancelling downloads. --- src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(); -- 2.7.4