X-Git-Url: https://git.pterodactylus.net/?p=xudocci.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fxdcc%2Fui%2Fstdin%2FDownloadCommand.java;fp=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fxdcc%2Fui%2Fstdin%2FDownloadCommand.java;h=75e92caf9cada369d59b790488f2564c4b4a9c77;hp=2fdec0d78b551ac4ee9309beceb1c8596db1d077;hb=8f3dfaa25a9ae48ed5bc836684d8dce7a4bf452b;hpb=46b4f2373ccda79ba837c86f4decbda1229a97d0 diff --git a/src/main/java/net/pterodactylus/xdcc/ui/stdin/DownloadCommand.java b/src/main/java/net/pterodactylus/xdcc/ui/stdin/DownloadCommand.java index 2fdec0d..75e92ca 100644 --- a/src/main/java/net/pterodactylus/xdcc/ui/stdin/DownloadCommand.java +++ b/src/main/java/net/pterodactylus/xdcc/ui/stdin/DownloadCommand.java @@ -65,6 +65,9 @@ public class DownloadCommand implements Command { @Override public State execute(State state, List parameters, Writer outputWriter) throws IOException { + if (parameters.isEmpty()) { + return state; + } Integer index = Ints.tryParse(parameters.get(0)); if ((index != null) && (index < state.getLastResults().size())) { core.fetch(state.getLastResults().get(index).bot(), state.getLastResults().get(index).pack());