cbeust / jcommander

Command line parsing framework for Java
Apache License 2.0
1.97k stars 334 forks source link

Fix an NPE #579

Closed jianglai closed 7 months ago

jianglai commented 7 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 7 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 7 months ago

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

mkarg commented 7 months ago

Thank you for your contribution! :-)