Skip to content

Commit ae5f926

Browse files
committed
RunArgument: fix bug when argument list is given
When an argument list is provided, we need to remove it from the list of pending command line arguments to process. Otherwise, it will get "double" processed, which can result in various weirdness. For instance, in ImageJ2 with the legacy layer active, the class net.imagej.legacy.LegacyCommandline$Filename.handle would try to handle the empty string as a filename and then barf.
1 parent fe807de commit ae5f926

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/java/org/scijava/run/console/RunArgument.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public void handle(final LinkedList<String> args) {
7575
args.removeFirst(); // --run
7676
final String code = args.removeFirst();
7777
final String arg = getParam(args);
78+
if (arg != null) args.removeFirst(); // argument list was given
7879

7980
try {
8081
if (arg == null) runService.run(code);

0 commit comments

Comments
 (0)