You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by jk...@apache.org on 2002/11/19 23:47:11 UTC

cvs commit: jakarta-commons/cli/src/java/org/apache/commons/cli CommandLine.java

jkeyes      2002/11/19 14:47:11

  Modified:    cli/src/java/org/apache/commons/cli CommandLine.java
  Log:
  applied a fix to prevent a NPE, reported by Boon Hian Tek
  
  Revision  Changes    Path
  1.16      +3 -0      jakarta-commons/cli/src/java/org/apache/commons/cli/CommandLine.java
  
  Index: CommandLine.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/java/org/apache/commons/cli/CommandLine.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- CommandLine.java	19 Nov 2002 00:16:18 -0000	1.15
  +++ CommandLine.java	19 Nov 2002 22:47:11 -0000	1.16
  @@ -135,6 +135,9 @@
       public Object getOptionObject( String opt ) {
           String res = getOptionValue( opt );
           
  +        if( !options.containsKey( opt ) ) {
  +            return null;
  +        }
           Object type = ((Option)options.get(opt)).getType();
           return res == null ? null : TypeHandler.createValue(res, type);
       }
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>