Skip to content
Permalink
Browse files
[JENKINS-14491] NPE reported by Jesse Jacob.
Form binding apparently neglects to pass empty lists to data-bound constructors, so check for null.
Reproducible even in 1.473 just by configuring publisher with no rows,
i.e. not actually the real problem reported in this bug (though made more apparent by it).
  • Loading branch information
jglick committed Jul 30, 2012
1 parent 24bebc0 commit d3d24157587d9e25fb634280b1787bbbf61bb38c
Showing 1 changed file with 1 addition and 1 deletion.
@@ -57,7 +57,7 @@ public class HtmlPublisher extends Recorder {

@DataBoundConstructor
public HtmlPublisher(List<HtmlPublisherTarget> reportTargets) {
this.reportTargets = new ArrayList<HtmlPublisherTarget>(reportTargets);
this.reportTargets = reportTargets != null ? new ArrayList<HtmlPublisherTarget>(reportTargets) : new ArrayList<HtmlPublisherTarget>();
}

public ArrayList<HtmlPublisherTarget> getReportTargets() {

2 comments on commit d3d2415

@mrooney
Copy link
Member

@mrooney mrooney commented on d3d2415 Aug 3, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks jglick!

@kodekraft
Copy link

@kodekraft kodekraft commented on d3d2415 Aug 9, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do u have any further instructions on applying this fix? thanks

Please sign in to comment.