From e762c701259cb4089f7ffb5db37fd38cbe8f22f7 Mon Sep 17 00:00:00 2001 From: Peter Reilly Date: Wed, 24 Sep 2003 15:51:27 +0000 Subject: [PATCH] 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 --- src/main/org/apache/tools/ant/taskdefs/LoadProperties.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/org/apache/tools/ant/taskdefs/LoadProperties.java b/src/main/org/apache/tools/ant/taskdefs/LoadProperties.java index 5ddaf5327..627afe154 100644 --- a/src/main/org/apache/tools/ant/taskdefs/LoadProperties.java +++ b/src/main/org/apache/tools/ant/taskdefs/LoadProperties.java @@ -137,6 +137,11 @@ public final class LoadProperties extends Task { throw new BuildException("Source file is not a file."); } + // Check if the source file is empty + if (srcFile.length() == 0) { + return; + } + FileInputStream fis = null; BufferedInputStream bis = null; Reader instream = null;