diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmBucketInfo.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmBucketInfo.java index 1cd6719820..14ed5f665b 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmBucketInfo.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmBucketInfo.java @@ -219,7 +219,9 @@ public Builder addMetadata(String key, String value) { } public Builder addAllMetadata(Map additionalMetadata) { - metadata.putAll(additionalMetadata); + if (additionalMetadata != null) { + metadata.putAll(additionalMetadata); + } return this; }