bodewig 2003/02/26 02:35:53
Modified: src/main/org/apache/tools/ant/taskdefs Tag: ANT_15_BRANCH
Input.java
Log:
Avoid NPE if input failed
Revision Changes Path
No revision
No revision
1.11.2.3 +5 -4 ant/src/main/org/apache/tools/ant/taskdefs/Input.java
Index: Input.java
===================================================================
RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Input.java,v
retrieving revision 1.11.2.2
retrieving revision 1.11.2.3
diff -u -r1.11.2.2 -r1.11.2.3
--- Input.java 10 Feb 2003 14:24:44 -0000 1.11.2.2
+++ Input.java 26 Feb 2003 10:35:53 -0000 1.11.2.3
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2001-2002 The Apache Software Foundation. All rights
+ * Copyright (c) 2001-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -123,7 +123,7 @@
}
/**
- * Actual test method executed by jakarta-ant.
+ * Actual method executed by jakarta-ant.
* @exception BuildException
*/
public void execute () throws BuildException {
@@ -137,8 +137,9 @@
getProject().getInputHandler().handleInput(request);
- if (addproperty != null) {
- project.setNewProperty(addproperty, request.getInput());
+ String value = request.getInput();
+ if (addproperty != null && value != null) {
+ project.setNewProperty(addproperty, value);
}
}