提交 54164110 编写于 作者: K Keith Zantow 提交者: Oleg Nenashev

[JENKINS-35206] - fix potential NPE due to corrupt Jenkins.InstallState (#2385)

上级 7a3e43c7
......@@ -88,10 +88,6 @@ public class InstallUtil {
* Proceed to the state following the provided one
*/
public static void proceedToNextStateFrom(InstallState prior) {
InstallState current = Jenkins.getInstance().getInstallState();
if (!current.equals(prior)) {
if (Main.isDevelopmentMode) LOGGER.warning("Transitioning state from: " + prior + ", but current is: " + current);
}
InstallState next = getNextInstallState(prior);
if (Main.isDevelopmentMode) LOGGER.info("Install state tranisitioning from: " + prior + " to: " + next);
if (next != null) {
......
......@@ -953,6 +953,9 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
@Nonnull
@Restricted(NoExternalUse.class)
public InstallState getInstallState() {
if (installState == null || installState.name() == null) {
return InstallState.UNKNOWN;
}
return installState;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册