You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2009/02/23 14:13:50 UTC

svn commit: r747004 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/taskdefs/Sync.java

Author: bodewig
Date: Mon Feb 23 13:13:48 2009
New Revision: 747004

URL: http://svn.apache.org/viewvc?rev=747004&view=rev
Log:
sync can cause NPE whith broken symlinks.  PR 46747.  Submitted by skoppehel at intersoft dot de

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Sync.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=747004&r1=747003&r2=747004&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Mon Feb 23 13:13:48 2009
@@ -356,6 +356,10 @@
    when writing zips or jars.
    Bugzilla Report 45548
 
+ * <sync> could into a NullPointerException when faced with broken
+   symbolic links.
+   Bugzilla Report 46747.
+
 Other changes:
 --------------
  * A HostInfo task was added performing information on hosts, including info on 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Sync.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Sync.java?rev=747004&r1=747003&r2=747004&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Sync.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Sync.java Mon Feb 23 13:13:48 2009
@@ -235,7 +235,8 @@
         // delete them.
         for (int i = dirs.length - 1; i >= 0; --i) {
             File f = new File(toDir, dirs[i]);
-            if (f.list().length < 1) {
+            String[] children = f.list();
+            if (children == null || children.length < 1) {
                 log("Removing orphan directory: " + f, Project.MSG_DEBUG);
                 f.delete();
                 ++removedCount[0];