Skip to content

Commit

Permalink
JENKINS-43400 Bail out early if the workspace does not exist or is a …
Browse files Browse the repository at this point in the history
…directory (#6)
  • Loading branch information
James William Dumay committed Apr 19, 2017
1 parent 23bae3c commit e4e4ca5
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -53,6 +53,12 @@ public void onCheckout(Run<?, ?> build, SCM scm, FilePath workspace, TaskListene
return;
}

// Bail out if the workspace does not exist or is not a directory
if (!workspace.exists() || !workspace.isDirectory()) {
LOGGER.fine("Workspace '" + workspace.getRemote() + "' does not exist or is a directory. Favoriting cannot be run.");
return;
}

BuildData buildData = build.getAction(BuildData.class);
Revision lastBuiltRevision = buildData.getLastBuiltRevision();
if (lastBuiltRevision == null) {
Expand Down

0 comments on commit e4e4ca5

Please sign in to comment.