Skip to content

Commit

Permalink
Merge branch 'upgrade-metadata' into 'main'
Browse files Browse the repository at this point in the history
Protect against missing metadata

See merge request weblogic-cloud/weblogic-kubernetes-operator!4795
  • Loading branch information
rjeberhard committed Aug 27, 2024
2 parents 348c28d + 4b4881e commit b64269f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2022, 2023, Oracle and/or its affiliates.
// Copyright (c) 2022, 2024, Oracle and/or its affiliates.
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.

package oracle.kubernetes.common.utils;
Expand Down Expand Up @@ -561,7 +561,7 @@ Map<String, Object> getStatus(Map<String, Object> domain) {
}

Map<String, Object> getMetadata(Map<String, Object> domain) {
return (Map<String, Object>) domain.get(METADATA);
return (Map<String, Object>) domain.computeIfAbsent(METADATA, k -> new LinkedHashMap<>());
}

@SuppressWarnings("unchecked")
Expand Down

0 comments on commit b64269f

Please sign in to comment.