Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #1724 from oleg-nenashev/AbstractProject_construct…
Browse files Browse the repository at this point in the history
…or_NPE

[FIXED JENKINS-28654] - Check null nodes condition in AbstractProject constructor
  • Loading branch information
oleg-nenashev committed Jun 7, 2015
2 parents 29f223a + a7ec87c commit 695a3d7
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 695a3d7

Please sign in to comment.