From 75e6e7f764495e29e7d15f0c40c125f7654616ee Mon Sep 17 00:00:00 2001 From: Peter Reilly Date: Mon, 13 Nov 2006 20:09:11 +0000 Subject: [PATCH] Bugzilla 40847: possible NPE in Jar.java git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@474481 13f79535-47bb-0310-9956-ffa450edef68 --- CONTRIBUTORS | 1 + WHATSNEW | 3 +++ contributors.xml | 4 ++++ src/main/org/apache/tools/ant/taskdefs/Jar.java | 2 +- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 661b29749..90f80f173 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -6,6 +6,7 @@ Alexey Solofnenko Andreas Ames Andreas Mross Andrew Everitt +Andrey Urazov Anil K. Vijendran Anli Shundi Anthony Goubard diff --git a/WHATSNEW b/WHATSNEW index 521c1b47a..3111ea6d8 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -17,6 +17,9 @@ Fixed bugs: take comparison with another CompressedResouce into account. Bugzilla 40949. +* possible NPE in Jar.java. + Bugzilla 40847 + Other changes: -------------- diff --git a/contributors.xml b/contributors.xml index 7f542ea93..f65dc24d0 100644 --- a/contributors.xml +++ b/contributors.xml @@ -34,6 +34,10 @@ Andrew Everitt + + Andrey + Urazov + Anil K. diff --git a/src/main/org/apache/tools/ant/taskdefs/Jar.java b/src/main/org/apache/tools/ant/taskdefs/Jar.java index 8f77c1356..f58788634 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Jar.java +++ b/src/main/org/apache/tools/ant/taskdefs/Jar.java @@ -526,7 +526,7 @@ public class Jar extends Zip { Manifest.Attribute classpath = mf.getMainSection().getAttribute(Manifest.ATTRIBUTE_CLASSPATH); String[] cpEntries = null; - if (classpath != null) { + if (classpath != null && classpath.getValue() != null) { StringTokenizer tok = new StringTokenizer(classpath.getValue(), " "); cpEntries = new String[tok.countTokens()];