Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-35206] - fix potential NPE due to corrupt Jenkins.InstallSta…
…te (#2385)
  • Loading branch information
kzantow authored and oleg-nenashev committed Jun 3, 2016
1 parent 7a3e43c commit 5416411
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 0 additions & 4 deletions core/src/main/java/jenkins/install/InstallUtil.java
Expand Up @@ -88,10 +88,6 @@ public T get() {
* 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) {
Expand Down
3 changes: 3 additions & 0 deletions core/src/main/java/jenkins/model/Jenkins.java
Expand Up @@ -953,6 +953,9 @@ private Object readResolve() {
@Nonnull
@Restricted(NoExternalUse.class)
public InstallState getInstallState() {
if (installState == null || installState.name() == null) {
return InstallState.UNKNOWN;
}
return installState;
}

Expand Down

0 comments on commit 5416411

Please sign in to comment.