Browse Source

PR 37765: Fixing NPE thanks to Dave Brosius

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@354099 13f79535-47bb-0310-9956-ffa450edef68
master
Jacobus Martinus Kruithof 19 years ago
parent
commit
74e4c0c477
3 changed files with 3 additions and 3 deletions
  1. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Reopen.java
  2. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Revert.java
  3. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Sync.java

+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Reopen.java View File

@@ -39,7 +39,7 @@ public class P4Reopen extends P4Base {
* @throws BuildException if the change parameter is null or empty
*/
public void setToChange(String toChange) throws BuildException {
if (toChange == null && !toChange.equals("")) {
if (toChange == null || toChange.equals("")) {
throw new BuildException("P4Reopen: tochange cannot be null or empty");
}



+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Revert.java View File

@@ -40,7 +40,7 @@ public class P4Revert extends P4Base {
* @throws BuildException if the change list is null or empty string
*/
public void setChange(String revertChange) throws BuildException {
if (revertChange == null && !revertChange.equals("")) {
if (revertChange == null || revertChange.equals("")) {
throw new BuildException("P4Revert: change cannot be null or empty");
}



+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Sync.java View File

@@ -58,7 +58,7 @@ public class P4Sync extends P4Base {
* @throws BuildException if label is null or empty string
*/
public void setLabel(String label) throws BuildException {
if (label == null && !label.equals("")) {
if (label == null || label.equals("")) {
throw new BuildException("P4Sync: Labels cannot be Null or Empty");
}



Loading…
Cancel
Save