fix potential crash

pull/22293/head
Mark D. Roth 5 years ago
parent 10266416c7
commit d89a70e152
  1. 4
      src/core/ext/filters/client_channel/lb_policy/xds/xds.cc

@ -1099,7 +1099,9 @@ void XdsLb::LocalityMap::UpdateXdsPickerLocked() {
const auto& locality_name = p.first;
Locality* locality = p.second.get();
// Skip the localities that are not in the latest locality map update.
if (!locality_map_update()->Contains(locality_name)) continue;
const auto* locality_update = locality_map_update();
if (locality_update == nullptr) continue;
if (!locality_update->Contains(locality_name)) continue;
if (locality->connectivity_state() != GRPC_CHANNEL_READY) continue;
end += locality->weight();
picker_list.push_back(

Loading…
Cancel
Save