diff --git a/CHANGELOG.md b/CHANGELOG.md index f309a4354f..48d2a3e4c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,3 +2,4 @@ --- [fix: fix RouterLabelRestTemplateInterceptor add response headers exception with httpclient5.](https://github.com/Tencent/spring-cloud-tencent/pull/1239) +- fix:fix NullPointerException when properties contain kv with null value. diff --git a/pom.xml b/pom.xml index 13dc09aa98..ae60ed9e9c 100644 --- a/pom.xml +++ b/pom.xml @@ -89,7 +89,7 @@ - 1.13.1-2023.0.0 + 1.13.2-2023.0.0 6.1.4 diff --git a/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/listener/PolarisConfigListenerContext.java b/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/listener/PolarisConfigListenerContext.java index 00f1ecb855..120ef7c73e 100644 --- a/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/listener/PolarisConfigListenerContext.java +++ b/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/listener/PolarisConfigListenerContext.java @@ -116,6 +116,11 @@ public static ExecutorService executor() { * @param ret origin properties map */ static void initialize(Map ret) { + for (Map.Entry entry : ret.entrySet()) { + if (entry.getValue() == null) { + ret.put(entry.getKey(), ""); + } + } properties.putAll(ret); } @@ -142,6 +147,9 @@ static Map merge(Map ret) { ret.keySet().parallelStream().forEach(key -> { Object oldValue = properties.getIfPresent(key); Object newValue = ret.get(key); + if (newValue == null) { + newValue = ""; + } if (oldValue != null) { if (!newValue.equals(oldValue)) { properties.put(key, newValue); diff --git a/spring-cloud-tencent-dependencies/pom.xml b/spring-cloud-tencent-dependencies/pom.xml index 9366fd844e..aefa23a645 100644 --- a/spring-cloud-tencent-dependencies/pom.xml +++ b/spring-cloud-tencent-dependencies/pom.xml @@ -70,7 +70,7 @@ - 1.13.1-2023.0.0 + 1.13.2-2023.0.0 1.15.0