aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakozak2011-11-24 07:48:45 (EST)
committerWinston Prakash2011-12-01 20:47:25 (EST)
commit7191b864c9278a43f30ab27c8e7fdda16bae286f (patch)
tree5b42af9d9c9489a0ce0ceb5b35af3e1929796c51
parent5470f85cc16764cfe3974dbf8a6feb7491bb17a0 (diff)
downloadorg.eclipse.hudson.core-7191b864c9278a43f30ab27c8e7fdda16bae286f.zip
org.eclipse.hudson.core-7191b864c9278a43f30ab27c8e7fdda16bae286f.tar.gz
org.eclipse.hudson.core-7191b864c9278a43f30ab27c8e7fdda16bae286f.tar.bz2
Fixed NPE (if the node on which the job previously had been built was not available)
Signed-off-by: Winston Prakash <winston.prakash@gmail.com>
-rw-r--r--hudson-core/src/main/java/hudson/model/AbstractProject.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/hudson-core/src/main/java/hudson/model/AbstractProject.java b/hudson-core/src/main/java/hudson/model/AbstractProject.java
index c728489..d936f4d 100644
--- a/hudson-core/src/main/java/hudson/model/AbstractProject.java
+++ b/hudson-core/src/main/java/hudson/model/AbstractProject.java
@@ -1527,7 +1527,12 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
return BUILD_NOW;
}
} else {
- WorkspaceList l = lb.getBuiltOn().toComputer().getWorkspaceList();
+ Node node = lb.getBuiltOn();
+ if (node == null || node.toComputer() == null) {
+ LOGGER.log(Level.FINE, "Node on which this job previously was built is not available now, build is started on an available node");
+ return isInQueue() ? NO_CHANGES : BUILD_NOW;
+ }
+ WorkspaceList l = node.toComputer().getWorkspaceList();
// if doing non-concurrent build, acquire a workspace in a way that causes builds to block for this workspace.
// this prevents multiple workspaces of the same job --- the behavior of Hudson < 1.319.
//