Skip to content
Permalink
Browse files

[JENKINS-29470] - Prevent NPE in AbstractProject.checkout when agent …

…disconnects during the build (#3094)

[JENKINS-29470] - Prevent NPE in AbstractProject.checkout when agent disconnects during the build

(cherry picked from commit b0c5a86)
  • Loading branch information...
piushkumar authored and olivergondza committed Mar 4, 2018
1 parent ff59e4b commit 9fb75bb4c6a7a43e472abae919fd32eef1983b92
Showing with 6 additions and 1 deletion.
  1. +6 −1 core/src/main/java/hudson/model/AbstractProject.java
@@ -1198,7 +1198,12 @@ public boolean checkout(AbstractBuild build, Launcher launcher, BuildListener li
return true; // no SCM

FilePath workspace = build.getWorkspace();
workspace.mkdirs();
if(workspace!=null){
workspace.mkdirs();
} else {
throw new AbortException("Cannot checkout SCM, workspace is not defined");
}


boolean r = scm.checkout(build, launcher, workspace, listener, changelogFile);
if (r) {

0 comments on commit 9fb75bb

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