1
0
mirror of https://gitee.com/mirrors/Spring-Cloud-Alibaba.git synced 2021-06-26 13:25:11 +08:00

Merge pull request #1536 from guerlab/master

[issue #1535 ]fix NacosServiceDiscovery.hostToServiceInstance  method potential NullPointerException
This commit is contained in:
Mercy Ma 2020-07-09 10:30:01 +08:00 committed by GitHub
commit 93cb226850
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,7 +92,9 @@ public class NacosServiceDiscovery {
metadata.put("nacos.weight", instance.getWeight() + "");
metadata.put("nacos.healthy", instance.isHealthy() + "");
metadata.put("nacos.cluster", instance.getClusterName() + "");
metadata.putAll(instance.getMetadata());
if (instance.getMetadata() != null) {
metadata.putAll(instance.getMetadata());
}
nacosServiceInstance.setMetadata(metadata);
if (metadata.containsKey("secure")) {