Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[FIX JENKINS-34857] Dont throw Exception when Jenkins.instance yields…
… null
  • Loading branch information
batmat committed May 16, 2016
1 parent c8d2f90 commit b8d244b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/jenkins/model/Jenkins.java
Expand Up @@ -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");
Expand Down

0 comments on commit b8d244b

Please sign in to comment.