NullPointerException in Util.stripLeadingHyphens when passed a null argument
----------------------------------------------------------------------------

                 Key: CLI-133
                 URL: https://issues.apache.org/jira/browse/CLI-133
             Project: Commons CLI
          Issue Type: Bug
          Components: CLI-1.x
    Affects Versions: 1.0, 1.1
            Reporter: Brian Egge
            Priority: Minor
             Fix For: 1.1


If you try to do a hasOption(null), you get a NPE:

java.lang.NullPointerException
        at org.apache.commons.cli.Util.stripLeadingHyphens(Util.java:39)
        at 
org.apache.commons.cli.CommandLine.resolveOption(CommandLine.java:166)
        at org.apache.commons.cli.CommandLine.hasOption(CommandLine.java:68)

Either hasOption should reject the null argument, or the function should simply 
return false.  I think the latter makes more since, as this is how Java 
collections generally work.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to