Skip to content
Permalink
Browse files

[FIX JENKINS-34857] Dont throw Exception when Jenkins.instance yields…

… null
  • Loading branch information...
batmat committed May 16, 2016
1 parent c8d2f90 commit b8d244b67733058ab2014c86517a0718680f01b2
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 b8d244b

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