From b1da0a110bc8a18d5a8e0f097b7e6f7f67bcc7d2 Mon Sep 17 00:00:00 2001 From: Ryan Eberhard Date: Wed, 15 Nov 2023 10:43:22 -0500 Subject: [PATCH] Resolve NPE for upgraded Failed status condition that is missing a severity level --- .../kubernetes/weblogic/domain/model/DomainConditionType.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/operator/src/main/java/oracle/kubernetes/weblogic/domain/model/DomainConditionType.java b/operator/src/main/java/oracle/kubernetes/weblogic/domain/model/DomainConditionType.java index 37d8cf941ae..982eabf84f2 100644 --- a/operator/src/main/java/oracle/kubernetes/weblogic/domain/model/DomainConditionType.java +++ b/operator/src/main/java/oracle/kubernetes/weblogic/domain/model/DomainConditionType.java @@ -6,6 +6,7 @@ import com.google.gson.annotations.SerializedName; import oracle.kubernetes.json.Obsoleteable; import oracle.kubernetes.operator.helpers.EventHelper; +import org.apache.commons.lang3.ObjectUtils; import static oracle.kubernetes.operator.helpers.EventHelper.EventItem.DOMAIN_AVAILABLE; import static oracle.kubernetes.operator.helpers.EventHelper.EventItem.DOMAIN_COMPLETE; @@ -21,7 +22,7 @@ public enum DomainConditionType implements Obsoleteable { @Override int compare(DomainCondition thisCondition, DomainCondition thatCondition) { if (compareUsingSeverities(thisCondition, thatCondition)) { - return thisCondition.getSeverity().compareTo(thatCondition.getSeverity()); + return ObjectUtils.compare(thisCondition.getSeverity(), thatCondition.getSeverity()); } else { return super.compare(thisCondition, thatCondition); }