Skip to content

Commit cdc9759

Browse files
idodeclareVladimir Kotal
authored andcommitted
Fix not to silently skip arguments
1 parent 82f67fa commit cdc9759

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/util/OptionParser.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,11 @@ public Option on(Object... args) {
431431
// to which the parser will take and convert.
432432
} else if (arg instanceof Class) {
433433
opt.setValueType((Class<?>) arg);
434+
} else if (arg == null) {
435+
throw new IllegalArgumentException("arg is null");
436+
} else {
437+
throw new IllegalArgumentException("Invalid arg: " +
438+
arg.getClass().getSimpleName() + " " + arg);
434439
}
435440
}
436441

0 commit comments

Comments
 (0)