From fb69519e68c53aa2830ac50915011867ab0b1971 Mon Sep 17 00:00:00 2001 From: Bharat Viswanadham Date: Fri, 25 Jan 2019 14:46:17 -0800 Subject: [PATCH] HDDS-1011. Fix NPE BucketManagerImpl.setBucketProperty. Contributed by Xiaoyu Yao. --- .../java/org/apache/hadoop/ozone/om/helpers/OmBucketInfo.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; }