ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterrei...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant UnknownElement.java
Date Tue, 22 Feb 2005 15:30:19 GMT
peterreilly    2005/02/22 07:30:19

  Modified:    src/main/org/apache/tools/ant UnknownElement.java
  Log:
   NPE when when <presetdef> tries to configure a task that
    cannot be instantiated.
  PR:  33689
  Reported by: Steve Loughran
  
  Revision  Changes    Path
  1.85      +5 -0      ant/src/main/org/apache/tools/ant/UnknownElement.java
  
  Index: UnknownElement.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/UnknownElement.java,v
  retrieving revision 1.84
  retrieving revision 1.85
  diff -u -r1.84 -r1.85
  --- UnknownElement.java	7 Jan 2005 21:56:59 -0000	1.84
  +++ UnknownElement.java	22 Feb 2005 15:30:19 -0000	1.85
  @@ -404,6 +404,11 @@
           if (o instanceof PreSetDef.PreSetDefinition) {
               PreSetDef.PreSetDefinition def = (PreSetDef.PreSetDefinition) o;
               o = def.createObject(ue.getProject());
  +            if (o == null) {
  +                throw getNotFoundException(
  +                    "preset " + name,
  +                    def.getPreSets().getComponentName());
  +            }
               ue.applyPreSet(def.getPreSets());
               if (o instanceof Task) {
                   Task task = (Task) o;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message