Skip to content
Permalink
Browse files

[FIXED JENKINS-10880] check if the workspace is null when fast remote…

… polling is enabled with multiple branches
  • Loading branch information
marc-guenther committed Apr 4, 2012
1 parent 0fbdcff commit edf09052d200bab3e83cf59a2f52d8cade99e9c9
Showing with 8 additions and 2 deletions.
  1. +8 −2 src/main/java/hudson/plugins/git/GitSCM.java
@@ -707,7 +707,9 @@ protected PollingResult compareRemoteRevisionWith(AbstractProject<?, ?> project,
// I'm actually not 100% sure about this, but I'll leave it in for now.
// Update 9/9/2010 - actually, I think this *was* needed, since we weren't doing a better check
// for whether we'd ever been built before. But I'm fixing that right now anyway.
if (!workingDirectory.exists()) {

// JENKINS-10880: workingDirectory can be null
if (workingDirectory == null || !workingDirectory.exists()) {
return PollingResult.BUILD_NOW;
}

@@ -1706,9 +1708,13 @@ protected FilePath workingDirectory(final FilePath workspace) {
* if no relative target dir is specified. Otherwise, it'll be "workspace/relativeTargetDir".
*
* @param workspace
* @return working directory
* @return working directory or null if workspace is null
*/
protected FilePath workingDirectory(final FilePath workspace, EnvVars environment) {
// JENKINS-10880: workspace can be null
if (workspace == null) {
return null;
}
if (relativeTargetDir == null || relativeTargetDir.length() == 0 || relativeTargetDir.equals(".")) {
return workspace;
}

0 comments on commit edf0905

Please sign in to comment.
You can’t perform that action at this time.