Skip to content

Commit

Permalink
[JENKINS-14491] NPE reported by Jesse Jacob.
Browse files Browse the repository at this point in the history
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 d3d2415
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/htmlpublisher/HtmlPublisher.java
Expand Up @@ -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() {
Expand Down

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

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.