Skip to content

Commit

Permalink
fix ClusterState.result may be null in CdsLoadBalancer2
Browse files Browse the repository at this point in the history
  • Loading branch information
skyguard1 committed Aug 4, 2021
1 parent 0d80c33 commit 9398147
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xds/src/main/java/io/grpc/xds/CdsLoadBalancer2.java
Expand Up @@ -185,7 +185,7 @@ private void handleClusterDiscovered() {
}
LoadBalancerProvider lbProvider = null;
Object lbConfig = null;
if (root.result.lbPolicy() == LbPolicy.RING_HASH) {
if (root.result != null && root.result.lbPolicy() == LbPolicy.RING_HASH) {
lbProvider = lbRegistry.getProvider("ring_hash");
lbConfig = new RingHashConfig(root.result.minRingSize(), root.result.maxRingSize());
} else {
Expand Down

0 comments on commit 9398147

Please sign in to comment.