From 83c26f549b5ef21e9956ff3e88ccb18fc7d96065 Mon Sep 17 00:00:00 2001 From: Peter Reilly Date: Tue, 22 Feb 2005 15:30:19 +0000 Subject: [PATCH] NPE when when tries to configure a task that cannot be instantiated. PR: 33689 Reported by: Steve Loughran git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277704 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 3 +++ src/main/org/apache/tools/ant/UnknownElement.java | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/WHATSNEW b/WHATSNEW index 1581d5368..f0af8797e 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -328,6 +328,9 @@ Fixed bugs: * couldn't store files with size between 2GB and 4GB (the upper limit set by the ZIP format itself). Bugzilla Report 33310. +* NPE when when tries to configure a task that + cannot be instantiated. Bugzilla Report 33689. + Changes from Ant 1.6.1 to Ant 1.6.2 =================================== diff --git a/src/main/org/apache/tools/ant/UnknownElement.java b/src/main/org/apache/tools/ant/UnknownElement.java index 1d5acf6ac..fd888f42e 100644 --- a/src/main/org/apache/tools/ant/UnknownElement.java +++ b/src/main/org/apache/tools/ant/UnknownElement.java @@ -404,6 +404,11 @@ public class UnknownElement extends Task { 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;