cbeust / jcommander

Command line parsing framework for Java
Apache License 2.0
1.94k stars 332 forks source link

Fix an NPE #579

Closed jianglai closed 4 months ago

jianglai commented 4 months ago

When mainParameter is null (which is the default), calling getMainParameterValue()/getMainParameterDescription() throws an NPE because it tries to access a field on a null object.

mkarg commented 4 months ago

Thank you for your pull request. Can you please be so kind and add a unit test that proofs that the bug is actually gone? Thanks! :-)

jianglai commented 4 months ago

PTAL. Added a test. The same test throws NPE when running against master.

mkarg commented 4 months ago

Thank you for your contribution! :-)