Skip to content

Commit

Permalink
[JENKINS-29470] - Prevent NPE in AbstractProject.checkout when agent …
Browse files Browse the repository at this point in the history
…disconnects during the build (#3094)

[JENKINS-29470] - Prevent NPE in AbstractProject.checkout when agent disconnects during the build
  • Loading branch information
piushkumar authored and oleg-nenashev committed Mar 4, 2018
1 parent d9e1f38 commit b0c5a86
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/src/main/java/hudson/model/AbstractProject.java
Expand Up @@ -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) {
Expand Down

0 comments on commit b0c5a86

Please sign in to comment.