Skip to content

Commit

Permalink
[fix]:方法无参时报空指针异常,issue:Snailclimb#49
Browse files Browse the repository at this point in the history
  • Loading branch information
Bond37 committed Nov 28, 2022
1 parent 6d09165 commit bf5ee8e
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;

/**
Expand All @@ -34,7 +31,7 @@ protected String doSelect(List<String> serviceAddresses, RpcRequest rpcRequest)
selectors.put(rpcServiceName, new ConsistentHashSelector(serviceAddresses, 160, identityHashCode));
selector = selectors.get(rpcServiceName);
}
return selector.select(rpcServiceName + Arrays.stream(rpcRequest.getParameters()));
return selector.select(rpcServiceName + Arrays.stream(Optional.ofNullable(rpcRequest.getParameters()).orElseGet(() -> new Object[0])));
}

static class ConsistentHashSelector {
Expand Down

0 comments on commit bf5ee8e

Please sign in to comment.