Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[FIXED JENKINS-28654] - Check null nodes condition in AbstractProject…
… constructor
  • Loading branch information
oleg-nenashev committed May 31, 2015
1 parent 9c443c8 commit a7ec87c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/main/java/hudson/model/AbstractProject.java
Expand Up @@ -266,7 +266,9 @@ protected AbstractProject(ItemGroup parent, String name) {
buildMixIn = createBuildMixIn();
builds = buildMixIn.getRunMap();

if(Jenkins.getInstance()!=null && !Jenkins.getInstance().getNodes().isEmpty()) {
final Jenkins j = Jenkins.getInstance();
final List<Node> nodes = j != null ? j.getNodes() : null;
if(nodes!=null && !nodes.isEmpty()) {
// if a new job is configured with Hudson that already has slave nodes
// make it roamable by default
canRoam = true;
Expand Down

0 comments on commit a7ec87c

Please sign in to comment.