commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jke...@apache.org
Subject cvs commit: jakarta-commons/cli/src/java/org/apache/commons/cli CommandLine.java
Date Tue, 19 Nov 2002 22:47:11 GMT
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:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message