airlift / airline

Java annotation-based framework for parsing Git like command line structures

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NPE when group has no default command

martint opened this issue · comments

builder.withGroup("foo")
    .withDefaultCommand(SomeCommand.class)    // <--- NPE if this line is missing
    .withCommands(SomeCommand.class);
Exception in thread "main" java.lang.NullPointerException
    at io.airlift.command.model.MetadataLoader.loadCommand(MetadataLoader.java:79)
    at io.airlift.command.Cli$1.apply(Cli.java:83)
    at io.airlift.command.Cli$1.apply(Cli.java:80)
    at com.google.common.collect.Iterators$8.transform(Iterators.java:860)
    at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
    at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:266)
    at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:223)
    at io.airlift.command.Cli.<init>(Cli.java:79)
    at io.airlift.command.Cli.<init>(Cli.java:40)
    at io.airlift.command.Cli$CliBuilder.build(Cli.java:243)