✅ Add first test for download command
[xudocci.git] / src / main / java / net / pterodactylus / xdcc / ui / stdin / DownloadCommand.java
index 2fdec0d..75e92ca 100644 (file)
@@ -65,6 +65,9 @@ public class DownloadCommand implements Command {
 
        @Override
        public State execute(State state, List<String> 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());