support datum is null case

This commit is contained in:
pbting 2019-08-09 10:55:38 +08:00
parent f09909cd1f
commit 6496ae5cd6

View File

@ -544,9 +544,11 @@ public class ServiceManager implements RecordListener<Service> {
currentInstances.put(instance.toIPAddr(), instance);
}
Map<String, Instance> instanceMap = null;
Map<String, Instance> instanceMap;
if (datum != null) {
instanceMap = setValid(((Instances) datum.value).getInstanceList(), currentInstances);
} else {
instanceMap = new HashMap<>(ips.length);
}
for (Instance instance : ips) {