Fix cancelling downloads.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 9 Aug 2013 14:06:05 +0000 (16:06 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 9 Aug 2013 14:06:05 +0000 (16:06 +0200)
src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java

index c78697a..c278ea5 100644 (file)
@@ -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();