Browse Source

Avoid NPE if input failed

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274178 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 23 years ago
parent
commit
bb1f1c678b
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/Input.java

+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/Input.java View File

@@ -133,7 +133,7 @@ public class Input extends Task {
} }


/** /**
* Actual test method executed by jakarta-ant.
* Actual method executed by jakarta-ant.
* @exception BuildException * @exception BuildException
*/ */
public void execute () throws BuildException { public void execute () throws BuildException {
@@ -152,7 +152,7 @@ public class Input extends Task {
&& defaultvalue != null) { && defaultvalue != null) {
value = defaultvalue; value = defaultvalue;
} }
if (addproperty != null) {
if (addproperty != null && value != null) {
getProject().setNewProperty(addproperty, value); getProject().setNewProperty(addproperty, value);
} }
} }


Loading…
Cancel
Save