提交 b8d244b6 编写于 作者: B Baptiste Mathus

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

上级 c8d2f903
......@@ -760,7 +760,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
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");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册