Browse Source

get loadproperties to check the size of the file before attemting to read it

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275333 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 21 years ago
parent
commit
e762c70125
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      src/main/org/apache/tools/ant/taskdefs/LoadProperties.java

+ 5
- 0
src/main/org/apache/tools/ant/taskdefs/LoadProperties.java View File

@@ -137,6 +137,11 @@ public final class LoadProperties extends Task {
throw new BuildException("Source file is not a file."); throw new BuildException("Source file is not a file.");
} }


// Check if the source file is empty
if (srcFile.length() == 0) {
return;
}
FileInputStream fis = null; FileInputStream fis = null;
BufferedInputStream bis = null; BufferedInputStream bis = null;
Reader instream = null; Reader instream = null;


Loading…
Cancel
Save