Browse Source

Avoid getting an NPE by making sure the property attr is set.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272810 13f79535-47bb-0310-9956-ffa450edef68
master
Diane Holt 23 years ago
parent
commit
337ae87977
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      src/main/org/apache/tools/ant/taskdefs/UpToDate.java

+ 4
- 0
src/main/org/apache/tools/ant/taskdefs/UpToDate.java View File

@@ -223,6 +223,10 @@ public class UpToDate extends Task implements Condition {
* than (each of) the corresponding source file(s).
*/
public void execute() throws BuildException {
if (_property == null) {
throw new BuildException("property attribute is required.",
location);
}
boolean upToDate = eval();
if (upToDate) {
this.project.setNewProperty(_property, getValue());


Loading…
Cancel
Save