Skip to content
Permalink
Browse files

JENKINS-43400 Bail out early if the workspace does not exist or is a …

…directory
  • Loading branch information...
i386 committed Apr 19, 2017
1 parent 23bae3c commit 614b076678aa40f6eb9233b8c044324b35074598
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/main/java/io/jenkins/blueocean/autofavorite/FavoritingScmListener.java
@@ -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) {

0 comments on commit 614b076

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