From 8a7b803fb148a2d92f0074479739534a58acc565 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Fri, 28 Jul 2006 19:10:22 +0000 Subject: [PATCH] avoid NPE in border-cases git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@426648 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/types/PropertySet.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/org/apache/tools/ant/types/PropertySet.java b/src/main/org/apache/tools/ant/types/PropertySet.java index 1af009983..36e8c1971 100644 --- a/src/main/org/apache/tools/ant/types/PropertySet.java +++ b/src/main/org/apache/tools/ant/types/PropertySet.java @@ -320,6 +320,9 @@ public class PropertySet extends DataType implements ResourceCollection { for (Iterator iter = names.iterator(); iter.hasNext();) { String name = (String) iter.next(); String value = (String) props.get(name); + if (value != null) { + // may be null if a system property has been added + // after the project instance has been initialized if (m != null) { //map the names String[] newname = m.mapFileName(name); @@ -328,6 +331,7 @@ public class PropertySet extends DataType implements ResourceCollection { } } properties.setProperty(name, value); + } } return properties; }