fix setting load bugf

This commit is contained in:
Looly
2024-03-25 12:10:06 +08:00
parent 082a8f67ac
commit d0641fc7e6
4 changed files with 28 additions and 5 deletions

View File

@@ -387,7 +387,12 @@ public class Setting extends AbsSetting implements Map<String, String> {
for (final Entry<String, LinkedHashMap<String, String>> groupEntry : this.groupedMap.entrySet()) {
group = groupEntry.getKey();
for (final Entry<String, String> entry : groupEntry.getValue().entrySet()) {
props.setProperty(StrUtil.isEmpty(group) ? entry.getKey() : group + CharUtil.DOT + entry.getKey(), entry.getValue());
// issue#I9B98C忽略null的键值对
final String key = entry.getKey();
final String value = entry.getValue();
if(null != key && null != value){
props.setProperty(StrUtil.isEmpty(group) ? key : group + CharUtil.DOT + key, value);
}
}
}
return props;