Skip to content

Commit

Permalink
[FIXED JENKINS-23749] If a pipeline does not have any builds it will …
Browse files Browse the repository at this point in the history
…throw a NPE.
  • Loading branch information
christ66 committed Sep 7, 2014
1 parent b6a01ad commit 880ba84
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -241,7 +241,7 @@ public BuildPipelineView(final String name, final String buildViewTitle,
super(name, Hudson.getInstance());
this.buildViewTitle = buildViewTitle;
this.gridBuilder = gridBuilder;
this.noOfDisplayedBuilds = noOfDisplayedBuilds;
this.noOfDisplayedBuilds = (noOfDisplayedBuilds == null) ? "1" : noOfDisplayedBuilds;
this.triggerOnlyLatestJob = triggerOnlyLatestJob;
this.cssUrl = cssUrl;
}
Expand Down Expand Up @@ -393,8 +393,10 @@ public boolean hasDownstreamProjects(final AbstractProject<?, ?> currentProject)
* @return - Representation of the projects and their related builds making up the build pipeline view
*/
public BuildPipelineForm getBuildPipelineForm() {
if (noOfDisplayedBuilds == null) return null;
final int maxNoOfDisplayBuilds = Integer.valueOf(noOfDisplayedBuilds);

if (gridBuilder == null) return null;
final ProjectGrid project = gridBuilder.build(this);
if (project.isEmpty()) {
return null;
Expand Down

0 comments on commit 880ba84

Please sign in to comment.