terrymanu commented on a change in pull request #5183:
UnconfiguredSchemaMetaData is NPE.
URL:
https://github.com/apache/incubator-shardingsphere/pull/5183#discussion_r408124381
##########
File path:
sharding-orchestration/sharding-orchestration-core/sharding-orchestration-core-metadatacenter/src/main/java/org/apache/shardingsphere/orchestration/core/metadatacenter/yaml/RuleSchemaMetaDataYamlSwapper.java
##########
@@ -47,8 +47,8 @@ public YamlRuleSchemaMetaData swap(final RuleSchemaMetaData
metaData) {
@Override
public RuleSchemaMetaData swap(final YamlRuleSchemaMetaData yaml) {
SchemaMetaData configured =
convertSchema(yaml.getConfiguredSchemaMetaData());
- Map<String, SchemaMetaData> unconfigured =
yaml.getUnconfiguredSchemaMetaDataMap().entrySet().stream()
- .collect(Collectors.toMap(entry -> entry.getKey(), entry ->
convertSchema(entry.getValue())));
+ Map<String, SchemaMetaData> unconfigured =
yaml.getUnconfiguredSchemaMetaDataMap() == null ? Collections.emptyMap() :
yaml.getUnconfiguredSchemaMetaDataMap().entrySet().stream()
Review comment:
We prefer use `null == xxx`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services