提交 91a62d65 编写于 作者: J Jesse Glick

[FIXED JENKINS-18193] NPE thrown when Jenkins failed to initialize.

Not really solving anything here—there is no plausible implementation that could run under these circumstances—
but at least reporting the problem more clearly.
上级 638537d0
......@@ -63,7 +63,11 @@ public abstract class ConfidentialStore {
public static @Nonnull ConfidentialStore get() {
if (TEST!=null) return TEST.get();
Lookup lookup = Jenkins.getInstance().lookup;
Jenkins j = Jenkins.getInstance();
if (j == null) {
throw new IllegalStateException("cannot initialize confidential key store until Jenkins has started");
}
Lookup lookup = j.lookup;
ConfidentialStore cs = lookup.get(ConfidentialStore.class);
if (cs==null) {
try {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册