Fix `ZookeeperConfigWatcherRegister.readConfig()` could cause `NPE` when `data.getData()` is null (#7611)
This commit is contained in:
parent
eb7fae2ef2
commit
313edd3097
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue