Author: maartenc Date: Thu Dec 23 21:59:12 2010 New Revision: 1052390 URL: http://svn.apache.org/viewvc?rev=1052390&view=rev Log: Fixed a possible NPE in the FileUtil#forceDelete method.
Modified: ant/ivy/core/trunk/CHANGES.txt ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileUtil.java Modified: ant/ivy/core/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=1052390&r1=1052389&r2=1052390&view=diff ============================================================================== --- ant/ivy/core/trunk/CHANGES.txt (original) +++ ant/ivy/core/trunk/CHANGES.txt Thu Dec 23 21:59:12 2010 @@ -117,6 +117,7 @@ for detailed view of each issue, please - NEW: ivy:resolve and post resole task can now have inlined dependencies declaration. - NEW: Import Bushel into Ivy core (IVY-1241) +- FIX: NullPointerException in FileUtil#forceDelete. - FIX: XmlModuleDescriptorUpdater is a mess that produces broken xmls in many cases (IVY-1010) - FIX: ivy.xml that contains UTF-8 encoded umlauts cannot be bigger than 10000 bytes (IVY-1253) - FIX: Can not use a v[revision] in an artifact pattern of a filesystem resolver (IVY-1238) Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileUtil.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileUtil.java?rev=1052390&r1=1052389&r2=1052390&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileUtil.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileUtil.java Thu Dec 23 21:59:12 2010 @@ -309,9 +309,11 @@ public final class FileUtil { } if (file.isDirectory()) { File[] files = file.listFiles(); - for (int i = 0; i < files.length; i++) { - if (!forceDelete(files[i])) { - return false; + if (files != null) { + for (int i = 0; i < files.length; i++) { + if (!forceDelete(files[i])) { + return false; + } } } }