Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
plugin might erranously put null into the collection, so filter them out
  • Loading branch information
kohsuke committed Feb 15, 2014
1 parent b87b1f1 commit 411c3cf
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions core/src/main/java/hudson/tasks/junit/TestResultAction.java
Expand Up @@ -162,18 +162,19 @@ private TestResult load() {
public Object getTarget() {
return getResult();
}

public List<TestAction> getActions(TestObject object) {
List<TestAction> result = new ArrayList<TestAction>();
// Added check for null testData to avoid NPE from issue 4257.
if (testData!=null) {
for (Data data : testData) {
result.addAll(data.getTestAction(object));
List<TestAction> result = new ArrayList<TestAction>();
// Added check for null testData to avoid NPE from issue 4257.
if (testData != null) {
for (Data data : testData)
for (TestAction ta : data.getTestAction(object))
if (ta != null)
result.add(ta);
}
return Collections.unmodifiableList(result);
}
return Collections.unmodifiableList(result);

}

public void setData(List<Data> testData) {
this.testData = testData;
}
Expand Down

0 comments on commit 411c3cf

Please sign in to comment.