Browse Source

Avoid NullPointerException in <delete> if the current user is not

allowed to list the contents of a directory.

Reported by:	"NIkhil R. Deshpande" <nikhild@flashmail.com>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268372 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 24 years ago
parent
commit
3a3312cb52
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      src/main/org/apache/tools/ant/taskdefs/Delete.java

+ 1
- 0
src/main/org/apache/tools/ant/taskdefs/Delete.java View File

@@ -270,6 +270,7 @@ public class Delete extends MatchingTask {


protected void removeDir(File d) { protected void removeDir(File d) {
String[] list = d.list(); String[] list = d.list();
if (list == null) list = new String[0];
for (int i = 0; i < list.length; i++) { for (int i = 0; i < list.length; i++) {
String s = list[i]; String s = list[i];
File f = new File(d, s); File f = new File(d, s);


Loading…
Cancel
Save