Skip to content

Commit

Permalink
[FIXED JENKINS-11878] fixing NPE during polling
Browse files Browse the repository at this point in the history
this particular NPE seems to be possible when the user switches an existing build to perforce, and attempts to use polling before executing the build at least once.
  • Loading branch information
rpetti committed Nov 26, 2011
1 parent c55d27e commit 9ebaf4e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/hudson/plugins/perforce/PerforceSCM.java
Expand Up @@ -874,7 +874,7 @@ else if (project.getLastBuild()!=null) {
baseline = new PerforceSCMRevisionState(-1);
}

if (project.getLastBuild() == null) {
if (project.getLastBuild() == null || baseline == null) {
listener.getLogger().println("No previous builds to use for comparison.");
return PollingResult.BUILD_NOW;
}
Expand Down

0 comments on commit 9ebaf4e

Please sign in to comment.