diff --git a/src/matcher/PluginLoader.java b/src/matcher/PluginLoader.java index 7cf00182..8ca378a4 100644 --- a/src/matcher/PluginLoader.java +++ b/src/matcher/PluginLoader.java @@ -23,7 +23,7 @@ public static void run(String[] args) { for (int i = 0; i < args.length; i++) { switch (args[i]) { case "--additional-plugins": - while (!args[i+1].startsWith("--")) { + while (i+1 < args.length && !args[i+1].startsWith("--")) { pluginPaths.add(Path.of(args[++i])); } diff --git a/src/matcher/gui/Gui.java b/src/matcher/gui/Gui.java index 2033e5f3..f7b5564e 100644 --- a/src/matcher/gui/Gui.java +++ b/src/matcher/gui/Gui.java @@ -135,35 +135,35 @@ private void handleStartupArgs(List args) { // ProjectConfig args case "--inputs-a": - while (!args.get(i+1).startsWith("--")) { + while (i+1 < args.size() && !args.get(i+1).startsWith("--")) { inputsA.add(Path.of(args.get(++i))); validProjectConfigArgPresent = true; } break; case "--inputs-b": - while (!args.get(i+1).startsWith("--")) { + while (i+1 < args.size() && !args.get(i+1).startsWith("--")) { inputsB.add(Path.of(args.get(++i))); validProjectConfigArgPresent = true; } break; case "--classpath-a": - while (!args.get(i+1).startsWith("--")) { + while (i+1 < args.size() && !args.get(i+1).startsWith("--")) { classPathA.add(Path.of(args.get(++i))); validProjectConfigArgPresent = true; } break; case "--classpath-b": - while (!args.get(i+1).startsWith("--")) { + while (i+1 < args.size() && !args.get(i+1).startsWith("--")) { classPathB.add(Path.of(args.get(++i))); validProjectConfigArgPresent = true; } break; case "--shared-classpath": - while (!args.get(i+1).startsWith("--")) { + while (i+1 < args.size() && !args.get(i+1).startsWith("--")) { sharedClassPath.add(Path.of(args.get(++i))); validProjectConfigArgPresent = true; }