diff --git a/core/src/main/java/hudson/model/AbstractProject.java b/core/src/main/java/hudson/model/AbstractProject.java index dd49267875bd619180303c8448300219748d44aa..190d45ca67d34e55ab33fca7bc2cfbed6e6e09df 100644 --- a/core/src/main/java/hudson/model/AbstractProject.java +++ b/core/src/main/java/hudson/model/AbstractProject.java @@ -266,7 +266,7 @@ public abstract class AbstractProject
,R extends A protected AbstractProject(ItemGroup parent, String name) { super(parent,name); - if(!Jenkins.getInstance().getNodes().isEmpty()) { + if(Jenkins.getInstance()!=null && !Jenkins.getInstance().getNodes().isEmpty()) { // if a new job is configured with Hudson that already has slave nodes // make it roamable by default canRoam = true;