Skip to content
Permalink
Browse files
[FIXED JENKINS-10880] check for existing lastBuild
Fix the NPE when there was no lastBuild available with
fast remote polling enabled
  • Loading branch information
marc-guenther committed Jun 25, 2012
1 parent 987a44a commit 91cc5c968070ffd6bb47568b5aa3d2da4859938b
Showing 1 changed file with 3 additions and 2 deletions.
@@ -662,13 +662,14 @@ protected PollingResult compareRemoteRevisionWith(AbstractProject<?, ?> project,

final BuildData buildData = fixNull(getBuildData(lastBuild, false));

if (buildData != null && buildData.lastBuild != null) {
if (buildData.lastBuild != null) {
listener.getLogger().println("[poll] Last Built Revision: " + buildData.lastBuild.revision);
}

final String singleBranch = getSingleBranch(lastBuild);

if (singleBranch != null && this.remotePoll) {
// fast remote polling needs a single branch and an existing last build
if (this.remotePoll && singleBranch != null && buildData.lastBuild != null && buildData.lastBuild.getRevision() != null) {
String gitExe = "";
GitTool[] installations = ((hudson.plugins.git.GitTool.DescriptorImpl)Hudson.getInstance().getDescriptorByType(GitTool.DescriptorImpl.class)).getInstallations();
for(GitTool i : installations) {

1 comment on commit 91cc5c9

@buildhive
Copy link

@buildhive buildhive commented on 91cc5c9 Jun 26, 2012

Choose a reason for hiding this comment

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

Jenkins » git-plugin #31 UNSTABLE
Looks like this commit caused a build failure
(what's this?)

Please sign in to comment.