Skip to content
Permalink
Browse files

Merge pull request #2355 from batmat/JENKINS-34857

[FIX JENKINS-34857] Don't throw Exception when Jenkins.getInstance() yields null
  • Loading branch information...
batmat committed May 16, 2016
2 parents c8d2f90 + b8d244b commit 85eff5f49470595d1ac884562671c5cb566bc161
Showing with 1 addition and 1 deletion.
  1. +1 −1 core/src/main/java/jenkins/model/Jenkins.java
@@ -760,7 +760,7 @@ public static Jenkins getInstanceOrNull() {
public static Jenkins getInstance() {
Jenkins instance = HOLDER.getInstance();
if (instance == null) {
if(!Boolean.getBoolean(Jenkins.class.getName()+".disableExceptionOnNullInstance")) {
if(Boolean.getBoolean(Jenkins.class.getName()+".enableExceptionOnNullInstance")) {
// TODO: remove that second block around 2.20 (that is: ~20 versions to battle test it)
// See https://github.com/jenkinsci/jenkins/pull/2297#issuecomment-216710150
throw new IllegalStateException("Jenkins has not been started, or was already shut down");

0 comments on commit 85eff5f

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