(bugfix) check null when obtaining the RpcClient. (#11042)

* fix-11028

* fix-11028

* fix-11028
This commit is contained in:
Guangdong Liu 2023-09-06 17:08:22 +08:00 committed by GitHub
parent 35bc0373a5
commit 27216603c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -98,7 +98,10 @@ public class ClusterRpcClientProxy extends MemberChangeListener {
Map.Entry<String, RpcClient> next1 = iterator.next();
if (next1.getKey().startsWith("Cluster-") && !newMemberKeys.contains(next1.getKey())) {
Loggers.CLUSTER.info("member leave,destroy client of member - > : {}", next1.getKey());
RpcClientFactory.getClient(next1.getKey()).shutdown();
RpcClient client = RpcClientFactory.getClient(next1.getKey());
if (client != null) {
RpcClientFactory.getClient(next1.getKey()).shutdown();
}
iterator.remove();
}
}