From 1b60864bf1589c54f8ee5d72effc9edd7aced4e0 Mon Sep 17 00:00:00 2001 From: Peter Reilly Date: Thu, 8 Jan 2004 13:36:34 +0000 Subject: [PATCH] Fix npe if does not have a "name" attribute PR: 25982 Obtained from: Dawid Weiss git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275875 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/types/PatternSet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/org/apache/tools/ant/types/PatternSet.java b/src/main/org/apache/tools/ant/types/PatternSet.java index 6c55cda2a..6e75aef79 100644 --- a/src/main/org/apache/tools/ant/types/PatternSet.java +++ b/src/main/org/apache/tools/ant/types/PatternSet.java @@ -123,7 +123,7 @@ public class PatternSet extends DataType implements Cloneable { } public String toString() { - StringBuffer buf = new StringBuffer(name); + StringBuffer buf = new StringBuffer(name != null ? name : ""); if ((ifCond != null) || (unlessCond != null)) { buf.append(":"); String connector = "";