Skip to content

Commit

Permalink
[fix][broker] Fix if dynamicConfig item in ZK do not exist in broker …
Browse files Browse the repository at this point in the history
…cause NPE (#17705)
  • Loading branch information
leizhiyuan authored Sep 19, 2022
1 parent 8b771a6 commit 8bc02aa
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2152,7 +2152,12 @@ private void handleDynamicConfigurationUpdates() {
}
Map<String, String> data = optMap.get();
data.forEach((configKey, value) -> {
Field configField = dynamicConfigurationMap.get(configKey).field;
ConfigField configFieldWrapper = dynamicConfigurationMap.get(configKey);
if (configFieldWrapper == null) {
log.warn("{} does not exist in dynamicConfigurationMap, skip this config.", configKey);
return;
}
Field configField = configFieldWrapper.field;
Object newValue = FieldParser.value(data.get(configKey), configField);
if (configField != null) {
Consumer listener = configRegisteredListeners.get(configKey);
Expand Down

0 comments on commit 8bc02aa

Please sign in to comment.