未验证 提交 313edd30 编写于 作者: W wankai123 提交者: GitHub

Fix `ZookeeperConfigWatcherRegister.readConfig()` could cause `NPE` when...

Fix `ZookeeperConfigWatcherRegister.readConfig()` could cause `NPE` when `data.getData()` is null (#7611)
上级 eb7fae2e
......@@ -48,6 +48,7 @@ Release Notes.
by `agent-analyzer.default.traceSamplingPolicySettingsFile`.
* Fix dynamic configuration watch implementation current value not null when the config is deleted.
* Fix `LoggingConfigWatcher` return `watch.value` would not consistent with the real configuration content.
* Fix `ZookeeperConfigWatcherRegister.readConfig()` could cause `NPE` when `data.getData()` is null.
#### UI
......
......@@ -52,7 +52,11 @@ public class ZookeeperConfigWatcherRegister extends ConfigWatcherRegister {
ConfigTable table = new ConfigTable();
keys.forEach(s -> {
ChildData data = this.childrenCache.getCurrentData(this.prefix + s);
table.add(new ConfigTable.ConfigItem(s, data == null ? null : new String(data.getData())));
String itemValue = null;
if (data != null && data.getData() != null) {
itemValue = new String(data.getData());
}
table.add(new ConfigTable.ConfigItem(s, itemValue));
});
return Optional.of(table);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册