Browse Source

Check if parent file is not null before using it

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275649 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 21 years ago
parent
commit
6cd4baf0a8
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/main/org/apache/tools/ant/util/FileUtils.java

+ 2
- 2
src/main/org/apache/tools/ant/util/FileUtils.java View File

@@ -545,7 +545,7 @@ public class FileUtils {
// ensure that parent dir of dest file exists!
// not using getParentFile method to stay 1.1 compat
File parent = getParentFile(destFile);
if (!parent.exists()) {
if (parent != null && !parent.exists()) {
parent.mkdirs();
}

@@ -1383,7 +1383,7 @@ public class FileUtils {
}

File parent = getParentFile(to);
if (!parent.exists() && !parent.mkdirs()) {
if (parent != null && !parent.exists() && !parent.mkdirs()) {
throw new IOException("Failed to create directory " + parent
+ " while trying to rename " + from);
}


Loading…
Cancel
Save